Refresh patches
Sophie Brun
3 years ago
4 | 4 | Bug-Kali: https://bugs.kali.org/view.php?id=2223 |
5 | 5 | Bug: https://bugzilla.gnome.org/show_bug.cgi?id=739480 |
6 | 6 | --- |
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(-) | |
9 | 9 | |
10 | diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js | |
11 | index 9d46506..74416fc 100644 | |
10 | 12 | --- a/extensions/apps-menu/extension.js |
11 | 13 | +++ 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 { | |
13 | 15 | }); |
14 | 16 | |
15 | 17 | var CategoryMenuItem = GObject.registerClass( |
59 | 61 | } |
60 | 62 | |
61 | 63 | _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) | |
63 | 66 | return; |
64 | 67 | |
65 | this._button.selectCategory(this._category); | |
68 | + this._button.selectCategory(this._category); | |
66 | 69 | + //this._button.scrollToCatButton(this); |
67 | 70 | + } |
68 | 71 | +}); |
84 | 87 | + } |
85 | 88 | + |
86 | 89 | + activate(event) { |
87 | + this._button.selectCategory(this._category); | |
90 | this._button.selectCategory(this._category); | |
88 | 91 | this._button.scrollToCatButton(this); |
89 | 92 | + super.activate(event); |
90 | 93 | + } |
120 | 123 | class ApplicationsMenu extends PopupMenu.PopupMenu { |
121 | 124 | constructor(sourceActor, arrowAlignment, arrowSide, button) { |
122 | 125 | super(sourceActor, arrowAlignment, arrowSide); |
123 | @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMe | |
126 | @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMenu.Button { | |
124 | 127 | _onTreeChanged() { |
125 | 128 | if (this.menu.isOpen) { |
126 | 129 | this._redisplay(); |
129 | 132 | } else { |
130 | 133 | this.reloadFlag = true; |
131 | 134 | } |
132 | @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMe | |
135 | @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMenu.Button { | |
133 | 136 | this._redisplay(); |
134 | 137 | this.reloadFlag = false; |
135 | 138 | } |
138 | 141 | } |
139 | 142 | super._onOpenStateChanged(menu, open); |
140 | 143 | } |
141 | @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMe | |
144 | @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMenu.Button { | |
142 | 145 | |
143 | 146 | _redisplay() { |
144 | 147 | this.applicationsBox.destroy_all_children(); |
155 | 158 | while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) { |
156 | 159 | if (nextType === GMenu.TreeItemType.ENTRY) { |
157 | 160 | let entry = iter.get_entry(); |
158 | @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMe | |
161 | @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMenu.Button { | |
159 | 162 | this.applicationsByCategory[categoryId].push('separator'); |
160 | 163 | } else if (nextType === GMenu.TreeItemType.DIRECTORY) { |
161 | 164 | let subdir = iter.get_directory(); |
175 | 178 | } |
176 | 179 | } |
177 | 180 | } |
178 | @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMe | |
181 | @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMenu.Button { | |
179 | 182 | } |
180 | 183 | |
181 | 184 | scrollToCatButton(button) { |
186 | 189 | let currentScrollValue = catsScrollBoxAdj.get_value(); |
187 | 190 | let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1; |
188 | 191 | 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 { | |
190 | 193 | _createLayout() { |
191 | 194 | let section = new PopupMenu.PopupMenuSection(); |
192 | 195 | this.menu.addMenuItem(section); |
198 | 201 | this.applicationsScrollBox = new St.ScrollView({ |
199 | 202 | style_class: 'apps-menu vfade', |
200 | 203 | x_expand: true, |
201 | @@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMe | |
204 | @@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMenu.Button { | |
202 | 205 | vscroll.connect('scroll-stop', () => { |
203 | 206 | this.menu.passEvents = false; |
204 | 207 | }); |
206 | 209 | this.categoriesScrollBox = new St.ScrollView({ |
207 | 210 | style_class: 'vfade', |
208 | 211 | }); |
209 | @@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMe | |
212 | @@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMenu.Button { | |
210 | 213 | vscroll.connect('scroll-start', () => (this.menu.passEvents = true)); |
211 | 214 | vscroll.connect('scroll-stop', () => (this.menu.passEvents = false)); |
212 | 215 | this.leftBox.add_child(this.categoriesScrollBox); |
218 | 221 | this.categoriesBox = new St.BoxLayout({ vertical: true }); |
219 | 222 | this.categoriesScrollBox.add_actor(this.categoriesBox); |
220 | 223 | |
221 | @@ -586,19 +655,29 @@ class ApplicationsButton extends PanelMe | |
224 | @@ -586,19 +655,29 @@ class ApplicationsButton extends PanelMenu.Button { | |
222 | 225 | this.mainBox.add_child(this._createVertSeparator()); |
223 | 226 | this.mainBox.add_child(this.applicationsScrollBox); |
224 | 227 | section.actor.add_actor(this.mainBox); |
251 | 254 | let iter = root.iter(); |
252 | 255 | let nextType; |
253 | 256 | 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 { | |
255 | 258 | |
256 | 259 | let categoryId = dir.get_menu_id(); |
257 | 260 | this.applicationsByCategory[categoryId] = []; |
269 | 272 | } |
270 | 273 | } |
271 | 274 | |
272 | @@ -623,9 +705,10 @@ class ApplicationsButton extends PanelMe | |
275 | @@ -623,9 +705,10 @@ class ApplicationsButton extends PanelMenu.Button { | |
273 | 276 | |
274 | 277 | let themeContext = St.ThemeContext.get_for_stage(global.stage); |
275 | 278 | let scaleFactor = themeContext.scale_factor; |
282 | 285 | } |
283 | 286 | |
284 | 287 | selectCategory(dir) { |
285 | @@ -640,6 +723,20 @@ class ApplicationsButton extends PanelMe | |
288 | @@ -640,6 +723,20 @@ class ApplicationsButton extends PanelMenu.Button { | |
286 | 289 | this._displayButtons(this._listApplications(dir.get_menu_id())); |
287 | 290 | else |
288 | 291 | this._displayButtons(this._listApplications(null)); |