Skip to content

Commit 8e3a01d

Browse files
committed
Add features requested in #8119
1 parent 5d8e49d commit 8e3a01d

File tree

12 files changed

+566
-39
lines changed

12 files changed

+566
-39
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### v1.1
2+
* Fix multi monitor interaction and element bleed
3+
* Added toggle to auto select search bar, horizontal scrolling with scroll wheel, and hotkey to toggle app drawer
4+
5+
### v1.0
6+
* Fully functional.

app-drawer@mostlynick3/files/app-drawer@mostlynick3/applet.js

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const Settings = imports.ui.settings;
77
const Util = imports.misc.util;
88
const Tweener = imports.ui.tweener;
99
const Tooltips = imports.ui.tooltips;
10+
const Keybinding = imports.ui.appletManager.applets['[email protected]'] ? imports.ui.settings : imports.ui.settings;
1011

1112
function MyApplet(metadata, orientation, panel_height, instance_id) {
1213
this._init(metadata, orientation, panel_height, instance_id);
@@ -31,6 +32,7 @@ MyApplet.prototype = {
3132
this.settings.bind("fontSize", "fontSize", this._onSettingsChanged.bind(this));
3233

3334
this.settings.bind("enableSearch", "enableSearch", this._onSettingsChanged.bind(this));
35+
this.settings.bind("autoFocusSearch", "autoFocusSearch");
3436
this.settings.bind("enableFavorites", "enableFavorites", this._onSettingsChanged.bind(this));
3537
this.settings.bind("favoriteApps", "favoriteApps");
3638

@@ -49,6 +51,8 @@ MyApplet.prototype = {
4951
this.settings.bind("pageAnimationType", "pageAnimationType");
5052
this.settings.bind("animationDuration", "animationDuration");
5153

54+
this.settings.bind("overlay-keybinding", "overlayKeybinding", this._onKeybindingChanged.bind(this));
55+
5256
this.modal = null;
5357
this.apps = [];
5458
this.filteredApps = [];
@@ -60,6 +64,27 @@ MyApplet.prototype = {
6064
this.isFirstOpen = true;
6165
this.activeTooltip = null;
6266
this.tooltipTimeout = null;
67+
68+
this._setupKeybinding();
69+
},
70+
71+
_setupKeybinding: function() {
72+
Main.keybindingManager.addHotKey(
73+
"overlay-keybinding-" + this.instance_id,
74+
this.overlayKeybinding,
75+
() => {
76+
if (this.modal) {
77+
this._destroyModal();
78+
} else {
79+
this._showModal();
80+
}
81+
}
82+
);
83+
},
84+
85+
_onKeybindingChanged: function() {
86+
Main.keybindingManager.removeHotKey("overlay-keybinding-" + this.instance_id);
87+
this._setupKeybinding();
6388
},
6489

6590
on_applet_clicked: function() {
@@ -250,6 +275,30 @@ MyApplet.prototype = {
250275
scrollView.add_actor(this.gridContainer);
251276
this.scrollAdjustment = scrollView.vscroll.adjustment;
252277

278+
scrollView.connect('scroll-event', (actor, event) => {
279+
let direction = event.get_scroll_direction();
280+
if (direction === Clutter.ScrollDirection.UP || direction === Clutter.ScrollDirection.DOWN) {
281+
let adjustment = scrollView.vscroll.adjustment;
282+
let increment = adjustment.step_increment * 3;
283+
let targetValue;
284+
285+
if (direction === Clutter.ScrollDirection.UP) {
286+
targetValue = Math.max(adjustment.lower, adjustment.value - increment);
287+
} else {
288+
targetValue = Math.min(adjustment.upper - adjustment.page_size, adjustment.value + increment);
289+
}
290+
291+
Tweener.addTween(adjustment, {
292+
value: targetValue,
293+
time: 0.3,
294+
transition: 'easeOutQuad'
295+
});
296+
297+
return Clutter.EVENT_STOP;
298+
}
299+
return Clutter.EVENT_PROPAGATE;
300+
});
301+
253302
container.add_actor(scrollView);
254303
} else if (this.navigationMode === 'scroll-horizontal') {
255304
let scrollView = new St.ScrollView({
@@ -267,6 +316,30 @@ MyApplet.prototype = {
267316
scrollView.add_actor(this.gridContainer);
268317
this.scrollAdjustment = scrollView.hscroll.adjustment;
269318

319+
scrollView.connect('scroll-event', (actor, event) => {
320+
let direction = event.get_scroll_direction();
321+
let adjustment = scrollView.hscroll.adjustment;
322+
let increment = adjustment.step_increment * 3;
323+
let targetValue;
324+
325+
if (direction === Clutter.ScrollDirection.UP) {
326+
targetValue = Math.max(adjustment.lower, adjustment.value - increment);
327+
} else if (direction === Clutter.ScrollDirection.DOWN) {
328+
targetValue = Math.min(adjustment.upper - adjustment.page_size, adjustment.value + increment);
329+
}
330+
331+
if (targetValue !== undefined) {
332+
Tweener.addTween(adjustment, {
333+
value: targetValue,
334+
time: 0.3,
335+
transition: 'easeOutQuad'
336+
});
337+
return Clutter.EVENT_STOP;
338+
}
339+
340+
return Clutter.EVENT_PROPAGATE;
341+
});
342+
270343
container.add_actor(scrollView);
271344
} else {
272345
this.gridContainer = new St.Widget({
@@ -384,6 +457,10 @@ MyApplet.prototype = {
384457
imports.mainloop.timeout_add(delay, () => {
385458
if (!this.modal) return false;
386459

460+
if (this.enableSearch && this.autoFocusSearch && this.searchEntry) {
461+
global.stage.set_key_focus(this.searchEntry.clutter_text);
462+
}
463+
387464
if (isFirst) {
388465
Tweener.addTween(this.modal, {
389466
opacity: 255,
@@ -725,7 +802,7 @@ MyApplet.prototype = {
725802
}
726803
},
727804

728-
_createAppButton: function(app, boxSize) {
805+
_createAppButton: function(app, boxSize) {
729806
let boxColor = this._rgbToRgba(this.boxColor, this.boxOpacity);
730807
let boxHoverColor = this._rgbToRgba(this.boxHoverColor, this.boxHoverOpacity);
731808
let spacing = Math.round(this.iconSize * 0.2);
@@ -995,6 +1072,7 @@ MyApplet.prototype = {
9951072
},
9961073

9971074
on_applet_removed_from_panel: function() {
1075+
Main.keybindingManager.removeHotKey("overlay-keybinding-" + this.instance_id);
9981076
this.enableAnimations = false;
9991077
this._destroyModal();
10001078
}

app-drawer@mostlynick3/files/app-drawer@mostlynick3/po/[email protected]

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#, fuzzy
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: app-drawer@mostlynick3 1.0\n"
8+
"Project-Id-Version: app-drawer@mostlynick3 1.2\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
1010
"issues\n"
11-
"POT-Creation-Date: 2025-12-17 08:31+0100\n"
11+
"POT-Creation-Date: 2026-01-02 08:33+0100\n"
1212
"PO-Revision-Date: \n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -79,10 +79,18 @@ msgstr ""
7979
msgid "Enable search bar"
8080
msgstr ""
8181

82+
#. settings-schema.json->autoFocusSearch->description
83+
msgid "Auto-focus search bar when opened"
84+
msgstr ""
85+
8286
#. settings-schema.json->enableFavorites->description
8387
msgid "Enable favorites"
8488
msgstr ""
8589

90+
#. settings-schema.json->overlay-keybinding->description
91+
msgid "Keyboard shortcut to toggle overlay"
92+
msgstr ""
93+
8694
#. settings-schema.json->appearance->description
8795
msgid "Appearance Settings"
8896
msgstr ""

app-drawer@mostlynick3/files/app-drawer@mostlynick3/po/da.po

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: app-drawer@mostlynick3 1.0\n"
9-
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/issues\n"
10-
"POT-Creation-Date: 2025-12-17 08:31+0100\n"
9+
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
10+
"issues\n"
11+
"POT-Creation-Date: 2026-01-02 08:33+0100\n"
1112
"PO-Revision-Date: 2025-12-18 12:00+0100\n"
1213
"Last-Translator: \n"
1314
"Language-Team: \n"
@@ -16,122 +17,180 @@ msgstr ""
1617
"Content-Type: text/plain; charset=UTF-8\n"
1718
"Content-Transfer-Encoding: 8bit\n"
1819

20+
#. metadata.json->name
1921
msgid "App Drawer"
2022
msgstr "Appskuffe"
2123

22-
msgid "Full-screen app launcher with animations, transparency, a search box, and more."
23-
msgstr "Fuldskærms appskuffe med animationer, gennemsigtighed, søgefelt og mere."
24+
#. metadata.json->description
25+
msgid ""
26+
"Full-screen app launcher with animations, transparency, a search box, and "
27+
"more."
28+
msgstr ""
29+
"Fuldskærms appskuffe med animationer, gennemsigtighed, søgefelt og mere."
2430

31+
#. settings-schema.json->navigation->description
2532
msgid "Navigation Settings"
2633
msgstr "Navigationsindstillinger"
2734

35+
#. settings-schema.json->navigationMode->description
2836
msgid "Navigation mode"
2937
msgstr "Navigationstilstand"
3038

39+
#. settings-schema.json->navigationMode->options
3140
msgid "Button Navigation"
3241
msgstr "Knapnavigation"
3342

43+
#. settings-schema.json->navigationMode->options
3444
msgid "Scroll Horizontal"
3545
msgstr "Horisontal rulning"
3646

47+
#. settings-schema.json->navigationMode->options
3748
msgid "Scroll Vertical"
3849
msgstr "Vertikal rulning"
3950

51+
#. settings-schema.json->layout->description
4052
msgid "Layout Settings"
4153
msgstr "Layoutindstillinger"
4254

55+
#. settings-schema.json->columns->description
4356
msgid "Columns per page"
4457
msgstr "Kolonner per side"
4558

59+
#. settings-schema.json->rows->description
4660
msgid "Rows per page"
4761
msgstr "Rækker per side"
4862

63+
#. settings-schema.json->iconSize->description
4964
msgid "Icon size (px)"
5065
msgstr "Ikonstørrelse (px)"
5166

67+
#. settings-schema.json->padding->description
5268
msgid "Padding (px)"
5369
msgstr "Mellemrum (px)"
5470

71+
#. settings-schema.json->fontSize->description
5572
msgid "Label font size (pt)"
5673
msgstr "Skriftstørrelse (pt)"
5774

75+
#. settings-schema.json->features->description
5876
msgid "Features"
5977
msgstr "Funktioner"
6078

79+
#. settings-schema.json->enableSearch->description
6180
msgid "Enable search bar"
6281
msgstr "Aktivér søgefelt"
6382

83+
#. settings-schema.json->autoFocusSearch->description
84+
msgid "Auto-focus search bar when opened"
85+
msgstr "Fokusér automatisk på søgefelt ved åbning"
86+
87+
#. settings-schema.json->enableFavorites->description
6488
msgid "Enable favorites"
6589
msgstr "Aktivér favoritter"
6690

91+
#. settings-schema.json->overlay-keybinding->description
92+
msgid "Keyboard shortcut to toggle overlay"
93+
msgstr "Tastaturgenvej til at slå overlay til/fra"
94+
95+
#. settings-schema.json->appearance->description
6796
msgid "Appearance Settings"
6897
msgstr "Designindstillinger"
6998

99+
#. settings-schema.json->bgColor->description
70100
msgid "Background color"
71101
msgstr "Baggrundsfarve"
72102

103+
#. settings-schema.json->bgOpacity->units
104+
#. settings-schema.json->containerOpacity->units
105+
#. settings-schema.json->boxOpacity->units
106+
#. settings-schema.json->boxHoverOpacity->units
73107
msgid "%"
74108
msgstr "%"
75109

110+
#. settings-schema.json->bgOpacity->description
76111
msgid "Background opacity"
77112
msgstr "Baggrundenes gennemsigtighed"
78113

114+
#. settings-schema.json->containerColor->description
79115
msgid "Container color"
80116
msgstr "Containerfarve"
81117

118+
#. settings-schema.json->containerOpacity->description
82119
msgid "Container opacity"
83120
msgstr "Containerens gennemsigtighed"
84121

122+
#. settings-schema.json->boxColor->description
85123
msgid "Box color"
86124
msgstr "Boksfarve"
87125

126+
#. settings-schema.json->boxOpacity->description
88127
msgid "Box opacity"
89128
msgstr "Boksens gennemsigtighed"
90129

130+
#. settings-schema.json->boxHoverColor->description
91131
msgid "Box hover color"
92132
msgstr "Boksfarve ved aktivering"
93133

134+
#. settings-schema.json->boxHoverOpacity->description
94135
msgid "Box hover opacity"
95136
msgstr "Boksens gennemsigtighed ved aktivering"
96137

138+
#. settings-schema.json->animations->description
97139
msgid "Animation Settings"
98140
msgstr "Animationsindstillinger"
99141

142+
#. settings-schema.json->enableAnimations->description
100143
msgid "Enable animations"
101144
msgstr "Aktivér animationer"
102145

146+
#. settings-schema.json->animationDuration->units
103147
msgid "ms"
104148
msgstr "ms"
105149

150+
#. settings-schema.json->animationDuration->description
106151
msgid "Animation duration"
107152
msgstr "Animationsvarighed"
108153

154+
#. settings-schema.json->openAnimationType->description
109155
msgid "Open animation"
110156
msgstr "Åbningsanimation"
111157

158+
#. settings-schema.json->openAnimationType->options
159+
#. settings-schema.json->closeAnimationType->options
160+
#. settings-schema.json->pageAnimationType->options
112161
msgid "Fade"
113162
msgstr "Tone"
114163

164+
#. settings-schema.json->openAnimationType->options
165+
#. settings-schema.json->closeAnimationType->options
115166
msgid "Scale"
116167
msgstr "Skaler"
117168

169+
#. settings-schema.json->openAnimationType->options
118170
msgid "Slide Up"
119171
msgstr "Gli op"
120172

173+
#. settings-schema.json->openAnimationType->options
174+
#. settings-schema.json->closeAnimationType->options
121175
msgid "Zoom"
122176
msgstr "Zoom"
123177

178+
#. settings-schema.json->closeAnimationType->description
124179
msgid "Close animation"
125180
msgstr "Lukningsanimation"
126181

182+
#. settings-schema.json->closeAnimationType->options
127183
msgid "Slide Down"
128184
msgstr "Gli ned"
129185

186+
#. settings-schema.json->pageAnimationType->description
130187
msgid "Button navigation page animation"
131188
msgstr "Knapnavigeringssideanimation"
132189

190+
#. settings-schema.json->pageAnimationType->options
133191
msgid "Slide"
134192
msgstr "Gli"
135193

194+
#. settings-schema.json->pageAnimationType->options
136195
msgid "Crossfade"
137-
msgstr "Krydstone"
196+
msgstr "Krydstone"

0 commit comments

Comments
 (0)