Codebase list gnome-shell-extensions / 039786c
Refresh patch Daniel Ruiz de Alegría 1 year, 7 months ago
1 changed file(s) with 19 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
77 extensions/apps-menu/extension.js | 152 +++++++++++++++++++++++++++++---------
88 1 file changed, 119 insertions(+), 33 deletions(-)
99
10 diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
11 index cc1d697..64c7017 100644
1210 --- a/extensions/apps-menu/extension.js
1311 +++ b/extensions/apps-menu/extension.js
14 @@ -98,34 +98,40 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
12 @@ -98,34 +98,40 @@
1513 }
1614 }
1715
4442 else
4543 name = _('Favorites');
4644
47 - this.add_child(new St.Label({ text: name }));
45 - this.add_child(new St.Label({text: name}));
4846 + super(name);
4947 +
5048 + this._category = category;
6563 }
6664
6765 _isNavigatingSubmenu([x, y]) {
68 @@ -217,11 +223,64 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
69 if (!this.active)
66 @@ -218,10 +224,63 @@
7067 return;
7168
72 + this._button.selectCategory(this._category);
69 this._button.selectCategory(this._category);
7370 + //this._button.scrollToCatButton(this);
7471 + }
7572 +}
9491 + }
9592 +
9693 + activate(event) {
97 this._button.selectCategory(this._category);
94 + this._button.selectCategory(this._category);
9895 this._button.scrollToCatButton(this);
9996 + super.activate(event);
10097 + }
130127 class ApplicationsMenu extends PopupMenu.PopupMenu {
131128 constructor(sourceActor, arrowAlignment, arrowSide, button) {
132129 super(sourceActor, arrowAlignment, arrowSide);
133 @@ -423,7 +482,7 @@ class ApplicationsButton extends PanelMenu.Button {
130 @@ -424,7 +483,7 @@
134131 _onTreeChanged() {
135132 if (this.menu.isOpen) {
136133 this._redisplay();
139136 } else {
140137 this.reloadFlag = true;
141138 }
142 @@ -484,20 +543,21 @@ class ApplicationsButton extends PanelMenu.Button {
139 @@ -485,20 +544,21 @@
143140 this._redisplay();
144141 this.reloadFlag = false;
145142 }
164161 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
165162 if (nextType === GMenu.TreeItemType.ENTRY) {
166163 let entry = iter.get_entry();
167 @@ -516,8 +576,17 @@ class ApplicationsButton extends PanelMenu.Button {
164 @@ -517,8 +577,17 @@
168165 this.applicationsByCategory[categoryId].push('separator');
169166 } else if (nextType === GMenu.TreeItemType.DIRECTORY) {
170167 let subdir = iter.get_directory();
184181 }
185182 }
186183 }
187 @@ -538,8 +607,8 @@ class ApplicationsButton extends PanelMenu.Button {
184 @@ -539,8 +608,8 @@
188185 }
189186
190187 scrollToCatButton(button) {
195192 let currentScrollValue = catsScrollBoxAdj.get_value();
196193 let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
197194 let buttonAlloc = button.get_allocation_box();
198 @@ -555,8 +624,9 @@ class ApplicationsButton extends PanelMenu.Button {
195 @@ -556,8 +625,9 @@
199196 _createLayout() {
200197 let section = new PopupMenu.PopupMenuSection();
201198 this.menu.addMenuItem(section);
202 - this.mainBox = new St.BoxLayout({ vertical: false });
203 - this.leftBox = new St.BoxLayout({ vertical: true });
199 - this.mainBox = new St.BoxLayout({vertical: false});
200 - this.leftBox = new St.BoxLayout({vertical: true});
204201 + this.mainBox = new PopupMenu.PopupMenuSection();
205202 + this.mainBox.actor.vertical = false;
206203 + this.leftBox = new PopupMenu.PopupMenuSection();
207204 this.applicationsScrollBox = new St.ScrollView({
208205 style_class: 'apps-menu vfade',
209206 x_expand: true,
210 @@ -569,6 +639,7 @@ class ApplicationsButton extends PanelMenu.Button {
207 @@ -570,6 +640,7 @@
211208 vscroll.connect('scroll-stop', () => {
212209 this.menu.passEvents = false;
213210 });
215212 this.categoriesScrollBox = new St.ScrollView({
216213 style_class: 'vfade',
217214 });
218 @@ -577,9 +648,10 @@ class ApplicationsButton extends PanelMenu.Button {
215 @@ -578,9 +649,10 @@
219216 vscroll.connect('scroll-start', () => (this.menu.passEvents = true));
220217 vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
221218 this.leftBox.add_child(this.categoriesScrollBox);
222219 -
223220 +*/
224 this.applicationsBox = new St.BoxLayout({ vertical: true });
221 this.applicationsBox = new St.BoxLayout({vertical: true});
225222 this.applicationsScrollBox.add_actor(this.applicationsBox);
226223 +/*
227 this.categoriesBox = new St.BoxLayout({ vertical: true });
224 this.categoriesBox = new St.BoxLayout({vertical: true});
228225 this.categoriesScrollBox.add_actor(this.categoriesBox);
229226
230 @@ -587,19 +659,29 @@ class ApplicationsButton extends PanelMenu.Button {
227 @@ -588,19 +660,29 @@
231228 this.mainBox.add_child(this._createVertSeparator());
232229 this.mainBox.add_child(this.applicationsScrollBox);
233230 section.actor.add_actor(this.mainBox);
260257 let iter = root.iter();
261258 let nextType;
262259 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
263 @@ -612,10 +694,13 @@ class ApplicationsButton extends PanelMenu.Button {
260 @@ -613,10 +695,13 @@
264261
265262 let categoryId = dir.get_menu_id();
266263 this.applicationsByCategory[categoryId] = [];
278275 }
279276 }
280277
281 @@ -624,9 +709,10 @@ class ApplicationsButton extends PanelMenu.Button {
278 @@ -625,9 +710,10 @@
282279
283280 let themeContext = St.ThemeContext.get_for_stage(global.stage);
284281 let scaleFactor = themeContext.scale_factor;