Codebase list gnome-shell-extensions / 1a98714
Sync with Debian Sophie Brun 4 years ago
2 changed file(s) with 32 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
0 gnome-shell-extensions (3.36.1-1kali1) kali-dev; urgency=medium
1
2 * Sync with Debian. Remaining changes:
3 - apps-menu with multiple levels
4
5 -- Sophie Brun <[email protected]> Thu, 16 Apr 2020 18:32:37 +0200
6
07 gnome-shell-extensions (3.36.1-1) unstable; urgency=medium
18
29 * Team upload
77 extensions/apps-menu/extension.js | 166 ++++++++++++++++++++++++++++++--------
88 1 file changed, 134 insertions(+), 32 deletions(-)
99
10 diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
11 index 70383af..1a1a373 100644
1210 --- a/extensions/apps-menu/extension.js
1311 +++ b/extensions/apps-menu/extension.js
14 @@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
12 @@ -97,30 +97,36 @@ class ApplicationMenuItem extends PopupM
1513 });
1614
1715 var CategoryMenuItem = GObject.registerClass(
6159 }
6260
6361 _isNavigatingSubmenu([x, y]) {
64 @@ -208,11 +214,61 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
65 if (!this.active)
62 @@ -209,10 +215,60 @@ class CategoryMenuItem extends PopupMenu
6663 return;
6764
68 + this._button.selectCategory(this._category);
65 this._button.selectCategory(this._category);
6966 + //this._button.scrollToCatButton(this);
7067 + }
7168 +});
8784 + }
8885 +
8986 + activate(event) {
90 this._button.selectCategory(this._category);
87 + this._button.selectCategory(this._category);
9188 this._button.scrollToCatButton(this);
9289 + super.activate(event);
9390 + }
123120 class ApplicationsMenu extends PopupMenu.PopupMenu {
124121 constructor(sourceActor, arrowAlignment, arrowSide, button) {
125122 super(sourceActor, arrowAlignment, arrowSide);
126 @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMenu.Button {
123 @@ -412,7 +468,7 @@ class ApplicationsButton extends PanelMe
127124 _onTreeChanged() {
128125 if (this.menu.isOpen) {
129126 this._redisplay();
132129 } else {
133130 this.reloadFlag = true;
134131 }
135 @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMenu.Button {
132 @@ -477,7 +533,7 @@ class ApplicationsButton extends PanelMe
136133 this._redisplay();
137134 this.reloadFlag = false;
138135 }
141138 }
142139 super._onOpenStateChanged(menu, open);
143140 }
144 @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMenu.Button {
141 @@ -490,13 +546,14 @@ class ApplicationsButton extends PanelMe
145142
146143 _redisplay() {
147144 this.applicationsBox.destroy_all_children();
158155 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
159156 if (nextType === GMenu.TreeItemType.ENTRY) {
160157 let entry = iter.get_entry();
161 @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMenu.Button {
158 @@ -515,8 +572,17 @@ class ApplicationsButton extends PanelMe
162159 this.applicationsByCategory[categoryId].push('separator');
163160 } else if (nextType === GMenu.TreeItemType.DIRECTORY) {
164161 let subdir = iter.get_directory();
178175 }
179176 }
180177 }
181 @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMenu.Button {
178 @@ -537,8 +603,8 @@ class ApplicationsButton extends PanelMe
182179 }
183180
184181 scrollToCatButton(button) {
189186 let currentScrollValue = catsScrollBoxAdj.get_value();
190187 let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
191188 let buttonAlloc = button.get_allocation_box();
192 @@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMenu.Button {
189 @@ -554,8 +620,9 @@ class ApplicationsButton extends PanelMe
193190 _createLayout() {
194191 let section = new PopupMenu.PopupMenuSection();
195192 this.menu.addMenuItem(section);
199196 + this.mainBox.actor.vertical = false;
200197 + this.leftBox = new PopupMenu.PopupMenuSection();
201198 this.applicationsScrollBox = new St.ScrollView({
202 x_fill: true,
203 y_fill: false,
204 @@ -570,6 +637,7 @@ class ApplicationsButton extends PanelMenu.Button {
199 style_class: 'apps-menu vfade',
200 x_expand: true,
201 @@ -568,6 +635,7 @@ class ApplicationsButton extends PanelMe
205202 vscroll.connect('scroll-stop', () => {
206203 this.menu.passEvents = false;
207204 });
208205 +/*
209206 this.categoriesScrollBox = new St.ScrollView({
210 x_fill: true,
211 y_fill: false,
212 @@ -586,9 +654,11 @@ class ApplicationsButton extends PanelMenu.Button {
213 y_fill: true,
214 y_align: St.Align.START,
207 style_class: 'vfade',
215208 });
209 @@ -576,9 +644,10 @@ class ApplicationsButton extends PanelMe
210 vscroll.connect('scroll-start', () => (this.menu.passEvents = true));
211 vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
212 this.leftBox.add_child(this.categoriesScrollBox);
213 -
216214 +*/
217
218215 this.applicationsBox = new St.BoxLayout({ vertical: true });
219216 this.applicationsScrollBox.add_actor(this.applicationsBox);
220217 +/*
221218 this.categoriesBox = new St.BoxLayout({ vertical: true });
222219 this.categoriesScrollBox.add_actor(this.categoriesBox);
223220
224 @@ -604,19 +674,33 @@ class ApplicationsButton extends PanelMenu.Button {
225 y_fill: true,
226 });
221 @@ -586,19 +655,33 @@ class ApplicationsButton extends PanelMe
222 this.mainBox.add_child(this._createVertSeparator());
223 this.mainBox.add_child(this.applicationsScrollBox);
227224 section.actor.add_actor(this.mainBox);
228225 +*/
229226 + this.categoriesBox = new PopupMenuScrollView();
258255 let iter = root.iter();
259256 let nextType;
260257 while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
261 @@ -629,10 +713,13 @@ class ApplicationsButton extends PanelMenu.Button {
258 @@ -611,10 +694,13 @@ class ApplicationsButton extends PanelMe
262259
263260 let categoryId = dir.get_menu_id();
264261 this.applicationsByCategory[categoryId] = [];
276273 }
277274 }
278275
279 @@ -641,9 +728,10 @@ class ApplicationsButton extends PanelMenu.Button {
276 @@ -623,9 +709,10 @@ class ApplicationsButton extends PanelMe
280277
281278 let themeContext = St.ThemeContext.get_for_stage(global.stage);
282279 let scaleFactor = themeContext.scale_factor;
289286 }
290287
291288 selectCategory(dir) {
292 @@ -658,6 +746,20 @@ class ApplicationsButton extends PanelMenu.Button {
289 @@ -640,6 +727,20 @@ class ApplicationsButton extends PanelMe
293290 this._displayButtons(this._listApplications(dir.get_menu_id()));
294291 else
295292 this._displayButtons(this._listApplications(null));