Codebase list gnome-shell-extensions / 7bc69de
Finish the kali menu patch for gnome-shell 3.34 Emilio Pozuelo Monfort 4 years ago
1 changed file(s) with 21 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
44 Bug-Kali: https://bugs.kali.org/view.php?id=2223
55 Bug: https://bugzilla.gnome.org/show_bug.cgi?id=739480
66 ---
7 extensions/apps-menu/extension.js | 170 +++++++++++++++++++++++++++++++-------
8 1 file changed, 139 insertions(+), 31 deletions(-)
7 extensions/apps-menu/extension.js | 165 ++++++++++++++++++++++++++++++--------
8 1 file changed, 133 insertions(+), 32 deletions(-)
99
1010 diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
11 index 70383af..1e5b884 100644
11 index 70383af..294074a 100644
1212 --- a/extensions/apps-menu/extension.js
1313 +++ b/extensions/apps-menu/extension.js
1414 @@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
222222 this.categoriesBox = new St.BoxLayout({ vertical: true });
223223 this.categoriesScrollBox.add_actor(this.categoriesBox);
224224
225 @@ -604,12 +673,32 @@ class ApplicationsButton extends PanelMenu.Button {
225 @@ -604,19 +673,33 @@ class ApplicationsButton extends PanelMenu.Button {
226226 y_fill: true,
227227 });
228228 section.actor.add_actor(this.mainBox);
231231 + vscroll = this.categoriesBox.actor.get_vscroll_bar();
232232 + vscroll.connect('scroll-start', () => { this.menu.passEvents = true; });
233233 + vscroll.connect('scroll-stop', () => { this.menu.passEvents = false; });
234 + this.leftBox.addMenuItem(this.categoriesBox);
235 + // we re-add it to apply the right properties
236234 + this.leftBox.actor.add(this.categoriesBox.actor, { expand: true,
237235 + x_fill: true, y_fill: true,
238236 + y_align: St.Align.START });
239 +
240 + this.leftBox.actor.add(activities.actor, { expand: false,
241 + x_fill: true, y_fill: false,
242 + y_align: St.Align.START });
243237 + this.mainBox.addMenuItem(this.leftBox);
244238 + this.mainBox.actor.add(this._createVertSeparator(), { expand: false,
245239 + x_fill: false, y_fill: true});
257251
258252 // Load categories
259253 this.applicationsByCategory = {};
260 @@ -629,10 +718,13 @@ class ApplicationsButton extends PanelMenu.Button {
254 this._tree.load_sync();
255 let root = this._tree.get_root_directory();
256 let categoryMenuItem = new CategoryMenuItem(this, null);
257 - this.categoriesBox.add_actor(categoryMenuItem);
258 + this.categoriesBox.addMenuItem(categoryMenuItem);
259 let iter = root.iter();
260 let nextType;
261 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
262 @@ -629,10 +712,13 @@ class ApplicationsButton extends PanelMenu.Button {
261263
262264 let categoryId = dir.get_menu_id();
263265 this.applicationsByCategory[categoryId] = [];
275277 }
276278 }
277279
278 @@ -641,9 +733,10 @@ class ApplicationsButton extends PanelMenu.Button {
280 @@ -641,9 +727,10 @@ class ApplicationsButton extends PanelMenu.Button {
279281
280282 let themeContext = St.ThemeContext.get_for_stage(global.stage);
281283 let scaleFactor = themeContext.scale_factor;
288290 }
289291
290292 selectCategory(dir) {
291 @@ -658,6 +751,21 @@ class ApplicationsButton extends PanelMenu.Button {
293 @@ -658,6 +745,20 @@ class ApplicationsButton extends PanelMenu.Button {
292294 this._displayButtons(this._listApplications(dir.get_menu_id()));
293295 else
294296 this._displayButtons(this._listApplications(null));
295297 +
296 + if (categoryMenuItem)
297 + this.updateOrnament(this.categoriesBox, categoryMenuItem);
298 + }
299 +
300 + updateOrnament(menu_item, category_menu_item) {
298 + this.updateOrnament(this.categoriesBox, dir);
299 + }
300 +
301 + updateOrnament(menu_item, category_dir) {
301302 + menu_item._getMenuItems().forEach(sub_menu_item => {
302303 + if (sub_menu_item.menu != undefined)
303 + this.updateOrnament(sub_menu_item.menu, category_menu_item);
304 + if (sub_menu_item == category_menu_item) {
304 + this.updateOrnament(sub_menu_item.menu, category_dir);
305 + if (sub_menu_item._category == category_dir) {
305306 + sub_menu_item.setOrnament(PopupMenu.Ornament.CHECK);
306307 + } else {
307308 + sub_menu_item.setOrnament(PopupMenu.Ornament.NONE);