Codebase list gnome-shell-extensions / 759c438
Refresh patches Sophie Brun 2 years ago
1 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
88 1 file changed, 130 insertions(+), 33 deletions(-)
99
1010 diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
11 index 9d46506..74416fc 100644
11 index e36b0fe..eac1f34 100644
1212 --- a/extensions/apps-menu/extension.js
1313 +++ b/extensions/apps-menu/extension.js
14 @@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
14 @@ -98,30 +98,36 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
1515 });
1616
1717 var CategoryMenuItem = GObject.registerClass(
6161 }
6262
6363 _isNavigatingSubmenu([x, y]) {
64 @@ -208,11 +214,61 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
64 @@ -209,11 +215,61 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
6565 if (!this.active)
6666 return;
6767
123123 class ApplicationsMenu extends PopupMenu.PopupMenu {
124124 constructor(sourceActor, arrowAlignment, arrowSide, button) {
125125 super(sourceActor, arrowAlignment, arrowSide);
126 @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMenu.Button {
126 @@ -409,7 +465,7 @@ class ApplicationsButton extends PanelMenu.Button {
127127 _onTreeChanged() {
128128 if (this.menu.isOpen) {
129129 this._redisplay();
132132 } else {
133133 this.reloadFlag = true;
134134 }
135 @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMenu.Button {
135 @@ -474,7 +530,7 @@ class ApplicationsButton extends PanelMenu.Button {
136136 this._redisplay();
137137 this.reloadFlag = false;
138138 }
141141 }
142142 super._onOpenStateChanged(menu, open);
143143 }
144 @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMenu.Button {
144 @@ -487,13 +543,14 @@ class ApplicationsButton extends PanelMenu.Button {
145145
146146 _redisplay() {
147147 this.applicationsBox.destroy_all_children();
158158 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
159159 if (nextType === GMenu.TreeItemType.ENTRY) {
160160 let entry = iter.get_entry();
161 @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMenu.Button {
161 @@ -512,8 +569,17 @@ class ApplicationsButton extends PanelMenu.Button {
162162 this.applicationsByCategory[categoryId].push('separator');
163163 } else if (nextType === GMenu.TreeItemType.DIRECTORY) {
164164 let subdir = iter.get_directory();
178178 }
179179 }
180180 }
181 @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMenu.Button {
181 @@ -534,8 +600,8 @@ class ApplicationsButton extends PanelMenu.Button {
182182 }
183183
184184 scrollToCatButton(button) {
189189 let currentScrollValue = catsScrollBoxAdj.get_value();
190190 let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
191191 let buttonAlloc = button.get_allocation_box();
192 @@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMenu.Button {
192 @@ -551,8 +617,9 @@ class ApplicationsButton extends PanelMenu.Button {
193193 _createLayout() {
194194 let section = new PopupMenu.PopupMenuSection();
195195 this.menu.addMenuItem(section);
201201 this.applicationsScrollBox = new St.ScrollView({
202202 style_class: 'apps-menu vfade',
203203 x_expand: true,
204 @@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMenu.Button {
204 @@ -565,6 +632,7 @@ class ApplicationsButton extends PanelMenu.Button {
205205 vscroll.connect('scroll-stop', () => {
206206 this.menu.passEvents = false;
207207 });
209209 this.categoriesScrollBox = new St.ScrollView({
210210 style_class: 'vfade',
211211 });
212 @@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMenu.Button {
212 @@ -573,9 +641,10 @@ class ApplicationsButton extends PanelMenu.Button {
213213 vscroll.connect('scroll-start', () => (this.menu.passEvents = true));
214214 vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
215215 this.leftBox.add_child(this.categoriesScrollBox);
221221 this.categoriesBox = new St.BoxLayout({ vertical: true });
222222 this.categoriesScrollBox.add_actor(this.categoriesBox);
223223
224 @@ -586,19 +655,29 @@ class ApplicationsButton extends PanelMenu.Button {
224 @@ -583,19 +652,29 @@ class ApplicationsButton extends PanelMenu.Button {
225225 this.mainBox.add_child(this._createVertSeparator());
226226 this.mainBox.add_child(this.applicationsScrollBox);
227227 section.actor.add_actor(this.mainBox);
254254 let iter = root.iter();
255255 let nextType;
256256 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
257 @@ -611,10 +690,13 @@ class ApplicationsButton extends PanelMenu.Button {
257 @@ -608,10 +687,13 @@ class ApplicationsButton extends PanelMenu.Button {
258258
259259 let categoryId = dir.get_menu_id();
260260 this.applicationsByCategory[categoryId] = [];
272272 }
273273 }
274274
275 @@ -623,9 +705,10 @@ class ApplicationsButton extends PanelMenu.Button {
275 @@ -620,9 +702,10 @@ class ApplicationsButton extends PanelMenu.Button {
276276
277277 let themeContext = St.ThemeContext.get_for_stage(global.stage);
278278 let scaleFactor = themeContext.scale_factor;
285285 }
286286
287287 selectCategory(dir) {
288 @@ -640,6 +723,20 @@ class ApplicationsButton extends PanelMenu.Button {
288 @@ -637,6 +720,20 @@ class ApplicationsButton extends PanelMenu.Button {
289289 this._displayButtons(this._listApplications(dir.get_menu_id()));
290290 else
291291 this._displayButtons(this._listApplications(null));