Codebase list gnome-shell-extensions / de4e1fe
Sync with Debian. Remaining changes: * Sync with Debian. Remaining changes: - apps-menu with multiple levels Sophie Brun 6 years ago
2 changed file(s) with 24 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
0 gnome-shell-extensions (3.26.2-1kali1) kali-dev; urgency=medium
1
2 * Sync with Debian. Remaining changes:
3 - apps-menu with multiple levels
4
5 -- Sophie Brun <[email protected]> Mon, 06 Nov 2017 16:04:03 +0100
6
07 gnome-shell-extensions (3.26.2-1) unstable; urgency=medium
18
29 * New upstream release
44
55 --- a/extensions/apps-menu/extension.js
66 +++ b/extensions/apps-menu/extension.js
7 @@ -92,10 +92,9 @@ const ApplicationMenuItem = new Lang.Cla
7 @@ -124,10 +124,9 @@ const ApplicationMenuItem = new Lang.Cla
88
99 const CategoryMenuItem = new Lang.Class({
1010 Name: 'CategoryMenuItem',
1616 this._category = category;
1717 this._button = button;
1818
19 @@ -108,8 +107,121 @@ const CategoryMenuItem = new Lang.Class(
19 @@ -140,8 +139,121 @@ const CategoryMenuItem = new Lang.Class(
2020 else
2121 name = _("Favorites");
2222
140140 },
141141
142142 activate: function(event) {
143 @@ -201,12 +313,29 @@ const CategoryMenuItem = new Lang.Class(
143 @@ -233,12 +345,29 @@ const CategoryMenuItem = new Lang.Class(
144144 setActive: function(active, params) {
145145 if (active) {
146146 this._button.selectCategory(this._category, this);
171171 const ApplicationsMenu = new Lang.Class({
172172 Name: 'ApplicationsMenu',
173173 Extends: PopupMenu.PopupMenu,
174 @@ -292,7 +421,7 @@ const ApplicationsButton = new Lang.Clas
174 @@ -473,7 +602,7 @@ const ApplicationsButton = new Lang.Clas
175175 this._installedChangedId = appSys.connect('installed-changed', Lang.bind(this, function() {
176176 if (this.menu.isOpen) {
177177 this._redisplay();
180180 } else {
181181 this.reloadFlag = true;
182182 }
183 @@ -371,7 +500,8 @@ const ApplicationsButton = new Lang.Clas
183 @@ -546,7 +675,8 @@ const ApplicationsButton = new Lang.Clas
184184 this._redisplay();
185185 this.reloadFlag = false;
186186 }
190190 }
191191 this.parent(menu, open);
192192 },
193 @@ -387,11 +517,11 @@ const ApplicationsButton = new Lang.Clas
193 @@ -562,11 +692,11 @@ const ApplicationsButton = new Lang.Clas
194194
195195 _redisplay: function() {
196196 this.applicationsBox.destroy_all_children();
204204 let iter = dir.iter();
205205 let nextType;
206206 while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
207 @@ -406,12 +536,24 @@ const ApplicationsButton = new Lang.Clas
207 @@ -581,12 +711,24 @@ const ApplicationsButton = new Lang.Clas
208208 let app = appSys.lookup_app(id);
209209 if (!app)
210210 app = new Shell.App({ app_info: entry.get_app_info() });
233233 }
234234 }
235235 },
236 @@ -432,8 +574,8 @@ const ApplicationsButton = new Lang.Clas
236 @@ -607,8 +749,8 @@ const ApplicationsButton = new Lang.Clas
237237 },
238238
239239 scrollToCatButton: function(button) {
244244 let currentScrollValue = catsScrollBoxAdj.get_value();
245245 let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
246246 let buttonAlloc = button.actor.get_allocation_box();
247 @@ -447,10 +589,16 @@ const ApplicationsButton = new Lang.Clas
247 @@ -622,10 +764,16 @@ const ApplicationsButton = new Lang.Clas
248248 },
249249
250250 _createLayout: function() {
263263 this.applicationsScrollBox = new St.ScrollView({ x_fill: true, y_fill: false,
264264 y_align: St.Align.START,
265265 style_class: 'apps-menu vfade' });
266 @@ -462,41 +610,55 @@ const ApplicationsButton = new Lang.Clas
266 @@ -637,41 +785,54 @@ const ApplicationsButton = new Lang.Clas
267267 vscroll.connect('scroll-stop', Lang.bind(this, function() {
268268 this.menu.passEvents = false;
269269 }));
290290 this.applicationsBox = new St.BoxLayout({ vertical: true });
291291 this.applicationsScrollBox.add_actor(this.applicationsBox);
292292 - this.categoriesBox = new St.BoxLayout({ vertical: true });
293 - this.categoriesScrollBox.add_actor(this.categoriesBox, { expand: true, x_fill: false });
294
293 - this.categoriesScrollBox.add_actor(this.categoriesBox);
294 -
295295 - this.mainBox.add(this.leftBox);
296296 - this.mainBox.add(this._createVertSeparator(), { expand: false, x_fill: false, y_fill: true});
297297 - this.mainBox.add(this.applicationsScrollBox, { expand: true, x_fill: true, y_fill: true });
302302 + this.menu.passEvents = true;
303303 + }));
304304 + vscroll.connect('scroll-stop', Lang.bind(this, function() {
305 + this.menu.passEvents = false;
305 + this.menu.passEvents = false;
306306 + }));
307307 + this.leftBox.addMenuItem(this.categoriesBox);
308308 + // FIXME we re-add it to apply the right properties, but re-adding
336336 },
337337
338338 _display: function() {
339 this._applicationsButtons = new Array();
339 this._applicationsButtons.clear();
340340 - this.mainBox.style=('width: 35em;');
341341 - this.mainBox.hide();
342342 + this.mainBox.actor.style=('width: 35em;');
344344
345345 //Load categories
346346 this.applicationsByCategory = {};
347 @@ -504,7 +666,7 @@ const ApplicationsButton = new Lang.Clas
347 @@ -679,7 +840,7 @@ const ApplicationsButton = new Lang.Clas
348348 tree.load_sync();
349349 let root = tree.get_root_directory();
350350 let categoryMenuItem = new CategoryMenuItem(this, null);
353353 let iter = root.iter();
354354 let nextType;
355355 while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
356 @@ -513,10 +675,12 @@ const ApplicationsButton = new Lang.Clas
356 @@ -688,10 +849,12 @@ const ApplicationsButton = new Lang.Clas
357357 if (!dir.get_is_nodisplay()) {
358358 let categoryId = dir.get_menu_id();
359359 this.applicationsByCategory[categoryId] = [];
370370 }
371371 }
372372 }
373 @@ -525,8 +689,9 @@ const ApplicationsButton = new Lang.Clas
373 @@ -700,8 +863,9 @@ const ApplicationsButton = new Lang.Clas
374374 //Load applications
375375 this._displayButtons(this._listApplications(null));
376376