7 | 7 |
extensions/apps-menu/extension.js | 166 ++++++++++++++++++++++++++++++--------
|
8 | 8 |
1 file changed, 134 insertions(+), 32 deletions(-)
|
9 | 9 |
|
10 | |
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
|
11 | |
index 70383af..1a1a373 100644
|
12 | 10 |
--- a/extensions/apps-menu/extension.js
|
13 | 11 |
+++ b/extensions/apps-menu/extension.js
|
14 | |
@@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
|
|
12 |
@@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupM
|
15 | 13 |
});
|
16 | 14 |
|
17 | 15 |
var CategoryMenuItem = GObject.registerClass(
|
|
61 | 59 |
}
|
62 | 60 |
|
63 | 61 |
_isNavigatingSubmenu([x, y]) {
|
64 | |
@@ -208,11 +214,61 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
|
65 | |
if (!this.active)
|
|
62 |
@@ -209,10 +215,60 @@ class CategoryMenuItem extends PopupMenu
|
66 | 63 |
return;
|
67 | 64 |
|
68 | |
+ this._button.selectCategory(this._category);
|
|
65 |
this._button.selectCategory(this._category);
|
69 | 66 |
+ //this._button.scrollToCatButton(this);
|
70 | 67 |
+ }
|
71 | 68 |
+});
|
|
87 | 84 |
+ }
|
88 | 85 |
+
|
89 | 86 |
+ activate(event) {
|
90 | |
this._button.selectCategory(this._category);
|
|
87 |
+ this._button.selectCategory(this._category);
|
91 | 88 |
this._button.scrollToCatButton(this);
|
92 | 89 |
+ super.activate(event);
|
93 | 90 |
+ }
|
|
123 | 120 |
class ApplicationsMenu extends PopupMenu.PopupMenu {
|
124 | 121 |
constructor(sourceActor, arrowAlignment, arrowSide, button) {
|
125 | 122 |
super(sourceActor, arrowAlignment, arrowSide);
|
126 | |
@@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
123 |
@@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMe
|
127 | 124 |
_onTreeChanged() {
|
128 | 125 |
if (this.menu.isOpen) {
|
129 | 126 |
this._redisplay();
|
|
132 | 129 |
} else {
|
133 | 130 |
this.reloadFlag = true;
|
134 | 131 |
}
|
135 | |
@@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
132 |
@@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMe
|
136 | 133 |
this._redisplay();
|
137 | 134 |
this.reloadFlag = false;
|
138 | 135 |
}
|
|
141 | 138 |
}
|
142 | 139 |
super._onOpenStateChanged(menu, open);
|
143 | 140 |
}
|
144 | |
@@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
141 |
@@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMe
|
145 | 142 |
|
146 | 143 |
_redisplay() {
|
147 | 144 |
this.applicationsBox.destroy_all_children();
|
|
158 | 155 |
while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
|
159 | 156 |
if (nextType === GMenu.TreeItemType.ENTRY) {
|
160 | 157 |
let entry = iter.get_entry();
|
161 | |
@@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
158 |
@@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMe
|
162 | 159 |
this.applicationsByCategory[categoryId].push('separator');
|
163 | 160 |
} else if (nextType === GMenu.TreeItemType.DIRECTORY) {
|
164 | 161 |
let subdir = iter.get_directory();
|
|
178 | 175 |
}
|
179 | 176 |
}
|
180 | 177 |
}
|
181 | |
@@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
178 |
@@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMe
|
182 | 179 |
}
|
183 | 180 |
|
184 | 181 |
scrollToCatButton(button) {
|
|
189 | 186 |
let currentScrollValue = catsScrollBoxAdj.get_value();
|
190 | 187 |
let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
|
191 | 188 |
let buttonAlloc = button.get_allocation_box();
|
192 | |
@@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
189 |
@@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMe
|
193 | 190 |
_createLayout() {
|
194 | 191 |
let section = new PopupMenu.PopupMenuSection();
|
195 | 192 |
this.menu.addMenuItem(section);
|
|
199 | 196 |
+ this.mainBox.actor.vertical = false;
|
200 | 197 |
+ this.leftBox = new PopupMenu.PopupMenuSection();
|
201 | 198 |
this.applicationsScrollBox = new St.ScrollView({
|
202 | |
x_fill: true,
|
203 | |
y_fill: false,
|
204 | |
@@ -570,6 +637,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
199 |
style_class: 'apps-menu vfade',
|
|
200 |
x_expand: true,
|
|
201 |
@@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMe
|
205 | 202 |
vscroll.connect('scroll-stop', () => {
|
206 | 203 |
this.menu.passEvents = false;
|
207 | 204 |
});
|
208 | 205 |
+/*
|
209 | 206 |
this.categoriesScrollBox = new St.ScrollView({
|
210 | |
x_fill: true,
|
211 | |
y_fill: false,
|
212 | |
@@ -586,9 +654,11 @@ class ApplicationsButton extends PanelMenu.Button {
|
213 | |
y_fill: true,
|
214 | |
y_align: St.Align.START,
|
|
207 |
style_class: 'vfade',
|
215 | 208 |
});
|
|
209 |
@@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMe
|
|
210 |
vscroll.connect('scroll-start', () => (this.menu.passEvents = true));
|
|
211 |
vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
|
|
212 |
this.leftBox.add_child(this.categoriesScrollBox);
|
|
213 |
-
|
216 | 214 |
+*/
|
217 | |
|
218 | 215 |
this.applicationsBox = new St.BoxLayout({ vertical: true });
|
219 | 216 |
this.applicationsScrollBox.add_actor(this.applicationsBox);
|
220 | 217 |
+/*
|
221 | 218 |
this.categoriesBox = new St.BoxLayout({ vertical: true });
|
222 | 219 |
this.categoriesScrollBox.add_actor(this.categoriesBox);
|
223 | 220 |
|
224 | |
@@ -604,19 +674,33 @@ class ApplicationsButton extends PanelMenu.Button {
|
225 | |
y_fill: true,
|
226 | |
});
|
|
221 |
@@ -586,19 +655,33 @@ class ApplicationsButton extends PanelMe
|
|
222 |
this.mainBox.add_child(this._createVertSeparator());
|
|
223 |
this.mainBox.add_child(this.applicationsScrollBox);
|
227 | 224 |
section.actor.add_actor(this.mainBox);
|
228 | 225 |
+*/
|
229 | 226 |
+ this.categoriesBox = new PopupMenuScrollView();
|
|
258 | 255 |
let iter = root.iter();
|
259 | 256 |
let nextType;
|
260 | 257 |
while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
|
261 | |
@@ -629,10 +713,13 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
258 |
@@ -611,10 +694,13 @@ class ApplicationsButton extends PanelMe
|
262 | 259 |
|
263 | 260 |
let categoryId = dir.get_menu_id();
|
264 | 261 |
this.applicationsByCategory[categoryId] = [];
|
|
276 | 273 |
}
|
277 | 274 |
}
|
278 | 275 |
|
279 | |
@@ -641,9 +728,10 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
276 |
@@ -623,9 +709,10 @@ class ApplicationsButton extends PanelMe
|
280 | 277 |
|
281 | 278 |
let themeContext = St.ThemeContext.get_for_stage(global.stage);
|
282 | 279 |
let scaleFactor = themeContext.scale_factor;
|
|
289 | 286 |
}
|
290 | 287 |
|
291 | 288 |
selectCategory(dir) {
|
292 | |
@@ -658,6 +746,20 @@ class ApplicationsButton extends PanelMenu.Button {
|
|
289 |
@@ -640,6 +727,20 @@ class ApplicationsButton extends PanelMe
|
293 | 290 |
this._displayButtons(this._listApplications(dir.get_menu_id()));
|
294 | 291 |
else
|
295 | 292 |
this._displayButtons(this._listApplications(null));
|