Codebase list gnome-shell-extensions / a17d455
Refresh patches Sophie Brun 3 years ago
1 changed file(s) with 21 addition(s) and 18 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 | 167 ++++++++++++++++++++++++++++++--------
8 1 file changed, 134 insertions(+), 33 deletions(-)
7 extensions/apps-menu/extension.js | 163 ++++++++++++++++++++++++++++++--------
8 1 file changed, 130 insertions(+), 33 deletions(-)
99
10 diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
11 index 9d46506..74416fc 100644
1012 --- a/extensions/apps-menu/extension.js
1113 +++ b/extensions/apps-menu/extension.js
12 @@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupM
14 @@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
1315 });
1416
1517 var CategoryMenuItem = GObject.registerClass(
5961 }
6062
6163 _isNavigatingSubmenu([x, y]) {
62 @@ -209,10 +215,60 @@ class CategoryMenuItem extends PopupMenu
64 @@ -208,11 +214,61 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
65 if (!this.active)
6366 return;
6467
65 this._button.selectCategory(this._category);
68 + this._button.selectCategory(this._category);
6669 + //this._button.scrollToCatButton(this);
6770 + }
6871 +});
8487 + }
8588 +
8689 + activate(event) {
87 + this._button.selectCategory(this._category);
90 this._button.selectCategory(this._category);
8891 this._button.scrollToCatButton(this);
8992 + super.activate(event);
9093 + }
120123 class ApplicationsMenu extends PopupMenu.PopupMenu {
121124 constructor(sourceActor, arrowAlignment, arrowSide, button) {
122125 super(sourceActor, arrowAlignment, arrowSide);
123 @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMe
126 @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMenu.Button {
124127 _onTreeChanged() {
125128 if (this.menu.isOpen) {
126129 this._redisplay();
129132 } else {
130133 this.reloadFlag = true;
131134 }
132 @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMe
135 @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMenu.Button {
133136 this._redisplay();
134137 this.reloadFlag = false;
135138 }
138141 }
139142 super._onOpenStateChanged(menu, open);
140143 }
141 @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMe
144 @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMenu.Button {
142145
143146 _redisplay() {
144147 this.applicationsBox.destroy_all_children();
155158 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
156159 if (nextType === GMenu.TreeItemType.ENTRY) {
157160 let entry = iter.get_entry();
158 @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMe
161 @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMenu.Button {
159162 this.applicationsByCategory[categoryId].push('separator');
160163 } else if (nextType === GMenu.TreeItemType.DIRECTORY) {
161164 let subdir = iter.get_directory();
175178 }
176179 }
177180 }
178 @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMe
181 @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMenu.Button {
179182 }
180183
181184 scrollToCatButton(button) {
186189 let currentScrollValue = catsScrollBoxAdj.get_value();
187190 let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
188191 let buttonAlloc = button.get_allocation_box();
189 @@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMe
192 @@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMenu.Button {
190193 _createLayout() {
191194 let section = new PopupMenu.PopupMenuSection();
192195 this.menu.addMenuItem(section);
198201 this.applicationsScrollBox = new St.ScrollView({
199202 style_class: 'apps-menu vfade',
200203 x_expand: true,
201 @@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMe
204 @@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMenu.Button {
202205 vscroll.connect('scroll-stop', () => {
203206 this.menu.passEvents = false;
204207 });
206209 this.categoriesScrollBox = new St.ScrollView({
207210 style_class: 'vfade',
208211 });
209 @@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMe
212 @@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMenu.Button {
210213 vscroll.connect('scroll-start', () => (this.menu.passEvents = true));
211214 vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
212215 this.leftBox.add_child(this.categoriesScrollBox);
218221 this.categoriesBox = new St.BoxLayout({ vertical: true });
219222 this.categoriesScrollBox.add_actor(this.categoriesBox);
220223
221 @@ -586,19 +655,29 @@ class ApplicationsButton extends PanelMe
224 @@ -586,19 +655,29 @@ class ApplicationsButton extends PanelMenu.Button {
222225 this.mainBox.add_child(this._createVertSeparator());
223226 this.mainBox.add_child(this.applicationsScrollBox);
224227 section.actor.add_actor(this.mainBox);
251254 let iter = root.iter();
252255 let nextType;
253256 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
254 @@ -611,10 +690,13 @@ class ApplicationsButton extends PanelMe
257 @@ -611,10 +690,13 @@ class ApplicationsButton extends PanelMenu.Button {
255258
256259 let categoryId = dir.get_menu_id();
257260 this.applicationsByCategory[categoryId] = [];
269272 }
270273 }
271274
272 @@ -623,9 +705,10 @@ class ApplicationsButton extends PanelMe
275 @@ -623,9 +705,10 @@ class ApplicationsButton extends PanelMenu.Button {
273276
274277 let themeContext = St.ThemeContext.get_for_stage(global.stage);
275278 let scaleFactor = themeContext.scale_factor;
282285 }
283286
284287 selectCategory(dir) {
285 @@ -640,6 +723,20 @@ class ApplicationsButton extends PanelMe
288 @@ -640,6 +723,20 @@ class ApplicationsButton extends PanelMenu.Button {
286289 this._displayButtons(this._listApplications(dir.get_menu_id()));
287290 else
288291 this._displayButtons(this._listApplications(null));