Skip to content

Commit 5ec94c9

Browse files
authored
quicklinks@NotSirius-A: Version 1.2 (#1592)
1 parent 53d837a commit 5ec94c9

7 files changed

Lines changed: 173 additions & 49 deletions

File tree

quicklinks@NotSirius-A/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ This desklet was designed to help clean up desktops with lots of icons and impro
1818

1919
You can customize this desklet to your taste. Choose from two layouts a list or tiles; change fonts, and icons or remove them entirely. You can use transparency or have solid colors, perhaps make the buttons large or compact. Check out the different options.
2020

21-
### What can be improved?
21+
### Tips
2222

23-
* This desklet could use more translations. I might add a Polish translation myself in the future.
23+
- You can add multiple desklets by clicking the "+" icons in your desklet manager.
24+
- You can backup your desklets by going to the settings. There you should find an icon in the top right corner. Select the `Export to a file` option or import to load your backup.
25+
- You can add a transparent border to your link to make them look bigger.
26+
- When you disable desklet decorations you can still grab the desklet by the invisible border around it.
2427

25-
* Improve font parsing.
28+
### What can be improved?
2629

27-
* More visual customizations could be added.
30+
* Improve font parsing.
2831

2932
* Unfortunately, the xlet settings API at this moment doesn't support `iconfilechooser` within `list` setting, so icons have to be typed in by name, which is somewhat annoying.
3033

3134

32-
3335
### Remarks
3436

3537
@schorschii thank You for your notes@schorschii desklet. I've used it as a template for this desklet (I also use it on my PC). Also, thanks to the other desklet authors I've used some of your code as a reference.

quicklinks@NotSirius-A/files/quicklinks@NotSirius-A/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
4+
## [1.2] - 14.10.2025
5+
6+
### Added
7+
8+
- Added new border styling + settings
9+
- Added new spacing styling + settings
10+
- Option to disable tooltips
11+
- Invisible padding without desklet decorations to make it easier to grab
12+
13+
### Changed
14+
15+
- Some default settings
16+
- Some setting names/positions
17+
- Decreased link padding slightly in `stylesheet.css`
18+
19+
### Fixed
20+
21+
- Incorrect width scaling width different display scales
22+
23+
324
## [1.1] - 16.06.2025
425

526
### Added

quicklinks@NotSirius-A/files/quicklinks@NotSirius-A/desklet.js

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ MyDesklet.prototype = {
4949
this.settings.bindProperty(Settings.BindingDirection.IN, "desklet-layout", "deskletLayout", this.on_setting_changed);
5050
this.settings.bindProperty(Settings.BindingDirection.IN, "text-align", "textAlign", this.on_setting_changed);
5151
this.settings.bindProperty(Settings.BindingDirection.IN, "column-number", "numOfColumns", this.on_setting_changed);
52+
this.settings.bindProperty(Settings.BindingDirection.IN, "row-spacing", "rowSpacing", this.on_setting_changed);
53+
this.settings.bindProperty(Settings.BindingDirection.IN, "column-spacing", "columnSpacing", this.on_setting_changed);
5254
this.settings.bindProperty(Settings.BindingDirection.IN, "transparent-bg", "isTransparentBg", this.on_setting_changed);
5355
this.settings.bindProperty(Settings.BindingDirection.IN, "bg-color", "customBgColor", this.on_setting_changed);
56+
this.settings.bindProperty(Settings.BindingDirection.IN, "link-border-width", "linkBorderWidth", this.on_setting_changed);
57+
this.settings.bindProperty(Settings.BindingDirection.IN, "link-border-color", "linkBorderColor", this.on_setting_changed);
5458
this.settings.bindProperty(Settings.BindingDirection.IN, "icon-size", "iconSize", this.on_setting_changed);
5559
this.settings.bindProperty(Settings.BindingDirection.IN, "font", "fontRaw", this.on_setting_changed);
5660
this.settings.bindProperty(Settings.BindingDirection.IN, "font-bold", "fontBold", this.on_setting_changed);
@@ -63,6 +67,7 @@ MyDesklet.prototype = {
6367
this.settings.bindProperty(Settings.BindingDirection.IN, "links-list", "linksList", ()=>{});
6468
this.settings.bindProperty(Settings.BindingDirection.IN, "click-type", "clickType", this.on_setting_changed);
6569
this.settings.bindProperty(Settings.BindingDirection.IN, "click-timeout", "clickTimeout", this.on_setting_changed);
70+
this.settings.bindProperty(Settings.BindingDirection.IN, "are-tooltips-enabled", "areTooltipsEnabled", this.on_setting_changed);
6671

6772
// List settings type seems to be a bit buggy
6873
// Using a callback on list type settings seems to trigger multiple refreshes when changing ANY settings
@@ -153,19 +158,23 @@ MyDesklet.prototype = {
153158
* Renders entire GUI except for decorations
154159
*/
155160
renderGUI: function() {
156-
const default_link_width = 95;
157-
const default_row_spacing = 5;
158-
const default_column_spacing = 5;
161+
const desktop_settings = new Gio.Settings({ schema_id: "org.cinnamon.desktop.interface" });
162+
this.text_scale = desktop_settings.get_double("text-scaling-factor");
163+
164+
this.font["size"] = this.font["size"] * this.text_scale;
165+
166+
// For some reason the border is inside the element not outside like normal CSS?? So border needs to be taken into account here
167+
const default_link_width = 80 + this.linkBorderWidth*12;
159168

160169
// Calculate new sizes based on scale and layout
161170
// Multipliers are based on experimentation with what looks good
162171
const width_scale = (this.deskletLayout === "tile")? 0.7 : 1
163172
this.scale = this.scaleSize * global.ui_scale * width_scale;
164-
this.link_width = default_link_width * this.scale;
173+
this.link_width = default_link_width * this.scale * this.text_scale;
165174

166175
const spacing_scale = (this.deskletLayout === "tile")? 2 : 1;
167-
const link_row_spacing = default_row_spacing * this.scale * spacing_scale;
168-
const link_column_spacing = default_column_spacing * this.scale * spacing_scale;
176+
const link_row_spacing = this.rowSpacing * this.scale * spacing_scale;
177+
const link_column_spacing = this.columnSpacing * this.scale * spacing_scale;
169178

170179
// Destroy root_el and its children to avoid creating multiple copies and orphaned elements.
171180
if (this.root_el) {
@@ -181,6 +190,8 @@ MyDesklet.prototype = {
181190
let container = new St.Group({style_class: "container " + this.deskletLayout});
182191
this.root_el.add_child(container);
183192

193+
container.style = (this.showDecorations ? "padding: 0.2em;" : "padding: 1em;");
194+
184195
let links_grid = new Clutter.GridLayout();
185196
links_grid.set_row_spacing(Math.round(link_row_spacing));
186197
links_grid.set_column_spacing(Math.round(link_column_spacing));
@@ -212,13 +223,14 @@ MyDesklet.prototype = {
212223

213224

214225
link_el.style = "font-family: '" + this.font["family"] + "';"
215-
+ "font-size: " + this.font["size"] + "px;"
216-
+ "color:" + this.customTextColor + ";"
217-
+ "font-weight:" + (this.fontBold ? "bold" : "normal") + ";"
218-
+ "font-style:" + (this.fontItalic ? "italic" : "normal") + ";"
219-
+ "text-shadow:" + (this.textShadow ? "1px 1px 6px "+this.textShadowColor : "none") + ";"
220-
+ "background-color:" + (this.isTransparentBg ? "unset" : this.customBgColor) + ";"
221-
+ "text-align:" + this.textAlign + ";";
226+
+ "font-size: " + this.font["size"] + "px;"
227+
+ "color:" + this.customTextColor + ";"
228+
+ "font-weight:" + (this.fontBold ? "bold" : "normal") + ";"
229+
+ "font-style:" + (this.fontItalic ? "italic" : "normal") + ";"
230+
+ "text-shadow:" + (this.textShadow ? "1px 1px 6px "+this.textShadowColor : "none") + ";"
231+
+ "background-color:" + (this.isTransparentBg ? "unset" : this.customBgColor) + ";"
232+
+ "text-align:" + this.textAlign + ";"
233+
+ "border: solid " + this.linkBorderWidth + "px " + this.linkBorderColor + ";";
222234

223235

224236
const row = link_index%this.numOfColumns;
@@ -253,7 +265,7 @@ MyDesklet.prototype = {
253265
if (this.deskletLayout === "tile") {
254266
label_width = Math.round(this.link_width * 0.92);
255267
} else {
256-
label_width = Math.round(this.link_width - this.iconSize*2.3 - this.font["size"] * 1.5)
268+
label_width = Math.round(this.link_width - global.ui_scale * (this.iconSize*1.1 + this.font["size"]*1.15 + 5))
257269
label_width = Math.max(label_width, 0);
258270
}
259271
link_label.set_width(label_width);
@@ -283,10 +295,11 @@ MyDesklet.prototype = {
283295
this.onLinkClick(link_index);
284296
}));
285297

286-
287-
// Add command to tooltip - display command when hovering over link element
288-
const command_line = link_data["command"];
289-
new Tooltips.Tooltip(link_el, command_line);
298+
if (this.areTooltipsEnabled) {
299+
// Add command to tooltip - display command when hovering over link element
300+
const command_line = link_data["command"];
301+
new Tooltips.Tooltip(link_el, command_line);
302+
}
290303
},
291304

292305
/**

quicklinks@NotSirius-A/files/quicklinks@NotSirius-A/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"max-instances": "10",
33
"description": "Customizable quick links panel. Allows you to create beautiful themed desktop shortcuts for your most used folders/commands.",
44
"name": "Quick Links",
5-
"version": "1.1",
5+
"version": "1.2",
66
"uuid": "quicklinks@NotSirius-A",
77
"author": "NotSirius-A"
88
}

quicklinks@NotSirius-A/files/quicklinks@NotSirius-A/po/quicklinks@NotSirius-A.pot

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#, fuzzy
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: quicklinks@NotSirius-A 1.1\n"
8+
"Project-Id-Version: quicklinks@NotSirius-A 1.2\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-desklets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2025-06-16 14:10+0200\n"
11+
"POT-Creation-Date: 2025-10-14 20:05+0200\n"
1212
"PO-Revision-Date: \n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -17,7 +17,7 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

20-
#. desklet.js:130
20+
#. desklet.js:135
2121
msgid ""
2222
"No visible\n"
2323
"links found.\n"
@@ -28,7 +28,7 @@ msgid ""
2828
"then configure."
2929
msgstr ""
3030

31-
#. desklet.js:344
31+
#. desklet.js:355
3232
msgid "Quick Links: Command parse error: "
3333
msgstr ""
3434

@@ -46,8 +46,8 @@ msgstr ""
4646
msgid "Links"
4747
msgstr ""
4848

49-
#. settings-schema.json->actions-page->title
50-
msgid "Actions"
49+
#. settings-schema.json->preferences-page->title
50+
msgid "Preferences"
5151
msgstr ""
5252

5353
#. settings-schema.json->theme-page->title
@@ -62,8 +62,8 @@ msgstr ""
6262
msgid "Find icon names here"
6363
msgstr ""
6464

65-
#. settings-schema.json->click-section->title
66-
msgid "Change how links are activated"
65+
#. settings-schema.json->general-section->title
66+
msgid "General"
6767
msgstr ""
6868

6969
#. settings-schema.json->layout-section->title
@@ -207,6 +207,22 @@ msgstr ""
207207
msgid "Increase or decrease the number of columns on the layout."
208208
msgstr ""
209209

210+
#. settings-schema.json->row-spacing->description
211+
msgid "Row spacing"
212+
msgstr ""
213+
214+
#. settings-schema.json->row-spacing->tooltip
215+
msgid "Change how far apart are link rows."
216+
msgstr ""
217+
218+
#. settings-schema.json->column-spacing->description
219+
msgid "Column spacing"
220+
msgstr ""
221+
222+
#. settings-schema.json->column-spacing->tooltip
223+
msgid "Change how far apart are link columns."
224+
msgstr ""
225+
210226
#. settings-schema.json->text-shadow->description
211227
msgid "Text shadow"
212228
msgstr ""
@@ -275,6 +291,24 @@ msgstr ""
275291
msgid "Set the text color of this desklet."
276292
msgstr ""
277293

294+
#. settings-schema.json->link-border-width->description
295+
msgid "Border width (set to 0 to disable border)"
296+
msgstr ""
297+
298+
#. settings-schema.json->link-border-width->tooltip
299+
msgid "Increase or decrease the link border width."
300+
msgstr ""
301+
302+
#. settings-schema.json->link-border-color->description
303+
msgid "Border color"
304+
msgstr ""
305+
306+
#. settings-schema.json->link-border-color->tooltip
307+
msgid ""
308+
"Set the link border color (Transparent border will add more padding to "
309+
"links)."
310+
msgstr ""
311+
278312
#. settings-schema.json->scale-size->units
279313
msgid "scale factor"
280314
msgstr ""
@@ -304,3 +338,11 @@ msgid ""
304338
"Set your desklet header. Make sure desklet headers are enabled in system "
305339
"settings."
306340
msgstr ""
341+
342+
#. settings-schema.json->are-tooltips-enabled->description
343+
msgid "Enable link tooltips"
344+
msgstr ""
345+
346+
#. settings-schema.json->are-tooltips-enabled->tooltip
347+
msgid "Select if you want tooltips to show up when hovering over links."
348+
msgstr ""

0 commit comments

Comments
 (0)