4 | 4 |
|
5 | 5 |
--- a/extensions/apps-menu/extension.js
|
6 | 6 |
+++ b/extensions/apps-menu/extension.js
|
7 | |
@@ -93,10 +93,9 @@ const ApplicationMenuItem = new Lang.Cla
|
|
7 |
@@ -92,10 +92,9 @@ const ApplicationMenuItem = new Lang.Cla
|
8 | 8 |
|
9 | 9 |
const CategoryMenuItem = new Lang.Class({
|
10 | 10 |
Name: 'CategoryMenuItem',
|
|
16 | 16 |
this._category = category;
|
17 | 17 |
this._button = button;
|
18 | 18 |
|
19 | |
@@ -109,13 +108,126 @@ const CategoryMenuItem = new Lang.Class(
|
|
19 |
@@ -108,8 +107,121 @@ const CategoryMenuItem = new Lang.Class(
|
20 | 20 |
else
|
21 | 21 |
name = _("Favorites");
|
22 | 22 |
|
|
25 | 25 |
+ this.parent(name);
|
26 | 26 |
+
|
27 | 27 |
+ //this.actor.connect('motion-event', Lang.bind(this, this._onMotionEvent));
|
28 | |
},
|
29 | |
|
30 | |
activate: function(event) {
|
31 | |
this._button.selectCategory(this._category, this);
|
32 | |
- this._button.scrollToCatButton(this);
|
|
28 |
+ },
|
|
29 |
+
|
|
30 |
+ activate: function(event) {
|
|
31 |
+ this._button.selectCategory(this._category, this);
|
33 | 32 |
+ //this._button.scrollToCatButton(this);
|
34 | 33 |
+ // we don't chain up here so that clicking on a category doesn't
|
35 | 34 |
+ // close the menu
|
|
138 | 137 |
+ this.parent(name, false);
|
139 | 138 |
+
|
140 | 139 |
+ //this.actor.connect('motion-event', Lang.bind(this, this._onMotionEvent));
|
141 | |
+ },
|
142 | |
+
|
143 | |
+ activate: function(event) {
|
144 | |
+ this._button.selectCategory(this._category, this);
|
145 | |
+ //this._button.scrollToCatButton(this);
|
146 | |
this.parent(event);
|
147 | |
},
|
148 | |
|
149 | |
@@ -197,12 +309,29 @@ const CategoryMenuItem = new Lang.Class(
|
|
140 |
},
|
|
141 |
|
|
142 |
activate: function(event) {
|
|
143 |
@@ -201,12 +313,29 @@ const CategoryMenuItem = new Lang.Class(
|
150 | 144 |
setActive: function(active, params) {
|
151 | 145 |
if (active) {
|
152 | 146 |
this._button.selectCategory(this._category, this);
|
|
174 | 168 |
+ },
|
175 | 169 |
+});
|
176 | 170 |
+
|
177 | |
const HotCorner = new Lang.Class({
|
178 | |
Name: 'HotCorner',
|
179 | |
Extends: Layout.HotCorner,
|
180 | |
@@ -305,7 +434,7 @@ const ApplicationsButton = new Lang.Clas
|
|
171 |
const ApplicationsMenu = new Lang.Class({
|
|
172 |
Name: 'ApplicationsMenu',
|
|
173 |
Extends: PopupMenu.PopupMenu,
|
|
174 |
@@ -292,7 +421,7 @@ const ApplicationsButton = new Lang.Clas
|
181 | 175 |
this._installedChangedId = appSys.connect('installed-changed', Lang.bind(this, function() {
|
182 | 176 |
if (this.menu.isOpen) {
|
183 | 177 |
this._redisplay();
|
|
186 | 180 |
} else {
|
187 | 181 |
this.reloadFlag = true;
|
188 | 182 |
}
|
189 | |
@@ -384,7 +513,8 @@ const ApplicationsButton = new Lang.Clas
|
|
183 |
@@ -371,7 +500,8 @@ const ApplicationsButton = new Lang.Clas
|
190 | 184 |
this._redisplay();
|
191 | 185 |
this.reloadFlag = false;
|
192 | 186 |
}
|
|
196 | 190 |
}
|
197 | 191 |
this.parent(menu, open);
|
198 | 192 |
},
|
199 | |
@@ -400,11 +530,11 @@ const ApplicationsButton = new Lang.Clas
|
|
193 |
@@ -387,11 +517,11 @@ const ApplicationsButton = new Lang.Clas
|
200 | 194 |
|
201 | 195 |
_redisplay: function() {
|
202 | 196 |
this.applicationsBox.destroy_all_children();
|
|
210 | 204 |
let iter = dir.iter();
|
211 | 205 |
let nextType;
|
212 | 206 |
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
|
213 | |
@@ -414,12 +544,21 @@ const ApplicationsButton = new Lang.Clas
|
214 | |
let app = appSys.lookup_app(entry.get_desktop_file_id());
|
|
207 |
@@ -407,12 +537,21 @@ const ApplicationsButton = new Lang.Clas
|
|
208 |
let app = appSys.lookup_app(id);
|
215 | 209 |
if (appInfo.should_show()) {
|
216 | 210 |
let menu_id = dir.get_menu_id();
|
217 | 211 |
- this.applicationsByCategory[categoryId].push(app);
|
|
235 | 229 |
}
|
236 | 230 |
}
|
237 | 231 |
},
|
238 | |
@@ -440,8 +579,8 @@ const ApplicationsButton = new Lang.Clas
|
|
232 |
@@ -433,8 +572,8 @@ const ApplicationsButton = new Lang.Clas
|
239 | 233 |
},
|
240 | 234 |
|
241 | 235 |
scrollToCatButton: function(button) {
|
|
246 | 240 |
let currentScrollValue = catsScrollBoxAdj.get_value();
|
247 | 241 |
let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
|
248 | 242 |
let buttonAlloc = button.actor.get_allocation_box();
|
249 | |
@@ -455,10 +594,16 @@ const ApplicationsButton = new Lang.Clas
|
|
243 |
@@ -448,10 +587,16 @@ const ApplicationsButton = new Lang.Clas
|
250 | 244 |
},
|
251 | 245 |
|
252 | 246 |
_createLayout: function() {
|
|
265 | 259 |
this.applicationsScrollBox = new St.ScrollView({ x_fill: true, y_fill: false,
|
266 | 260 |
y_align: St.Align.START,
|
267 | 261 |
style_class: 'apps-menu vfade' });
|
268 | |
@@ -470,41 +615,55 @@ const ApplicationsButton = new Lang.Clas
|
|
262 |
@@ -463,41 +608,55 @@ const ApplicationsButton = new Lang.Clas
|
269 | 263 |
vscroll.connect('scroll-stop', Lang.bind(this, function() {
|
270 | 264 |
this.menu.passEvents = false;
|
271 | 265 |
}));
|
|
346 | 340 |
|
347 | 341 |
//Load categories
|
348 | 342 |
this.applicationsByCategory = {};
|
349 | |
@@ -512,7 +671,7 @@ const ApplicationsButton = new Lang.Clas
|
|
343 |
@@ -505,7 +664,7 @@ const ApplicationsButton = new Lang.Clas
|
350 | 344 |
tree.load_sync();
|
351 | 345 |
let root = tree.get_root_directory();
|
352 | 346 |
let categoryMenuItem = new CategoryMenuItem(this, null);
|
|
355 | 349 |
let iter = root.iter();
|
356 | 350 |
let nextType;
|
357 | 351 |
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
|
358 | |
@@ -521,10 +680,12 @@ const ApplicationsButton = new Lang.Clas
|
|
352 |
@@ -514,10 +673,12 @@ const ApplicationsButton = new Lang.Clas
|
359 | 353 |
if (!dir.get_is_nodisplay()) {
|
360 | 354 |
let categoryId = dir.get_menu_id();
|
361 | 355 |
this.applicationsByCategory[categoryId] = [];
|
|
372 | 366 |
}
|
373 | 367 |
}
|
374 | 368 |
}
|
375 | |
@@ -533,8 +694,9 @@ const ApplicationsButton = new Lang.Clas
|
|
369 |
@@ -526,8 +687,9 @@ const ApplicationsButton = new Lang.Clas
|
376 | 370 |
//Load applications
|
377 | 371 |
this._displayButtons(this._listApplications(null));
|
378 | 372 |
|