204 | 204 |
let iter = dir.iter();
|
205 | 205 |
let nextType;
|
206 | 206 |
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
|
207 | |
@@ -407,12 +537,21 @@ const ApplicationsButton = new Lang.Clas
|
|
207 |
@@ -404,12 +534,23 @@ const ApplicationsButton = new Lang.Clas
|
|
208 |
continue;
|
|
209 |
}
|
208 | 210 |
let app = appSys.lookup_app(id);
|
209 | |
if (appInfo.should_show()) {
|
210 | |
let menu_id = dir.get_menu_id();
|
|
211 |
- if (app.get_app_info().should_show())
|
211 | 212 |
- this.applicationsByCategory[categoryId].push(app);
|
|
213 |
+ if (app.get_app_info().should_show()) {
|
|
214 |
+ let menu_id = dir.get_menu_id();
|
212 | 215 |
+ this.applicationsByCategory[menu_id].push(app);
|
213 | |
}
|
|
216 |
+ }
|
214 | 217 |
} else if (nextType == GMenu.TreeItemType.DIRECTORY) {
|
215 | 218 |
let subdir = iter.get_directory();
|
216 | 219 |
- if (!subdir.get_is_nodisplay())
|
|
225 | 228 |
+ if (this.applicationsByCategory[menu_id].length > 0 || !categoryMenuItem.menu.isEmpty()) {
|
226 | 229 |
+ parentCategory.menu.addMenuItem(categoryMenuItem);
|
227 | 230 |
+ }
|
228 | |
+ }
|
|
231 |
+ }
|
229 | 232 |
}
|
230 | 233 |
}
|
231 | 234 |
},
|
232 | |
@@ -433,8 +572,8 @@ const ApplicationsButton = new Lang.Clas
|
|
235 |
@@ -430,8 +571,8 @@ const ApplicationsButton = new Lang.Clas
|
233 | 236 |
},
|
234 | 237 |
|
235 | 238 |
scrollToCatButton: function(button) {
|
|
240 | 243 |
let currentScrollValue = catsScrollBoxAdj.get_value();
|
241 | 244 |
let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
|
242 | 245 |
let buttonAlloc = button.actor.get_allocation_box();
|
243 | |
@@ -448,10 +587,16 @@ const ApplicationsButton = new Lang.Clas
|
|
246 |
@@ -445,10 +586,16 @@ const ApplicationsButton = new Lang.Clas
|
244 | 247 |
},
|
245 | 248 |
|
246 | 249 |
_createLayout: function() {
|
|
259 | 262 |
this.applicationsScrollBox = new St.ScrollView({ x_fill: true, y_fill: false,
|
260 | 263 |
y_align: St.Align.START,
|
261 | 264 |
style_class: 'apps-menu vfade' });
|
262 | |
@@ -463,41 +608,55 @@ const ApplicationsButton = new Lang.Clas
|
|
265 |
@@ -460,41 +607,55 @@ const ApplicationsButton = new Lang.Clas
|
263 | 266 |
vscroll.connect('scroll-stop', Lang.bind(this, function() {
|
264 | 267 |
this.menu.passEvents = false;
|
265 | 268 |
}));
|
|
340 | 343 |
|
341 | 344 |
//Load categories
|
342 | 345 |
this.applicationsByCategory = {};
|
343 | |
@@ -505,7 +664,7 @@ const ApplicationsButton = new Lang.Clas
|
|
346 |
@@ -502,7 +663,7 @@ const ApplicationsButton = new Lang.Clas
|
344 | 347 |
tree.load_sync();
|
345 | 348 |
let root = tree.get_root_directory();
|
346 | 349 |
let categoryMenuItem = new CategoryMenuItem(this, null);
|
|
349 | 352 |
let iter = root.iter();
|
350 | 353 |
let nextType;
|
351 | 354 |
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
|
352 | |
@@ -514,10 +673,12 @@ const ApplicationsButton = new Lang.Clas
|
|
355 |
@@ -511,10 +672,12 @@ const ApplicationsButton = new Lang.Clas
|
353 | 356 |
if (!dir.get_is_nodisplay()) {
|
354 | 357 |
let categoryId = dir.get_menu_id();
|
355 | 358 |
this.applicationsByCategory[categoryId] = [];
|
|
366 | 369 |
}
|
367 | 370 |
}
|
368 | 371 |
}
|
369 | |
@@ -526,8 +687,9 @@ const ApplicationsButton = new Lang.Clas
|
|
372 |
@@ -523,8 +686,9 @@ const ApplicationsButton = new Lang.Clas
|
370 | 373 |
//Load applications
|
371 | 374 |
this._displayButtons(this._listApplications(null));
|
372 | 375 |
|