146 | 146 |
this.parent(event);
|
147 | 147 |
},
|
148 | 148 |
|
149 | |
@@ -201,12 +313,31 @@ const CategoryMenuItem = new Lang.Class(
|
|
149 |
@@ -201,12 +313,29 @@ const CategoryMenuItem = new Lang.Class(
|
150 | 150 |
setActive: function(active, params) {
|
151 | 151 |
if (active) {
|
152 | 152 |
this._button.selectCategory(this._category, this);
|
|
168 | 168 |
+ hscrollbar_policy: Gtk.PolicyType.NEVER,
|
169 | 169 |
+ vscrollbar_policy: Gtk.PolicyType.AUTOMATIC });
|
170 | 170 |
+
|
171 | |
+ this.container = new Shell.GenericContainer();
|
172 | |
+ this.box.add_actor(this.container);
|
173 | 171 |
+ this.actor.add_actor(this.box);
|
174 | 172 |
+ this.actor._delegate = this;
|
175 | 173 |
+ this.actor.clip_to_allocation = true;
|
|
179 | 177 |
const HotCorner = new Lang.Class({
|
180 | 178 |
Name: 'HotCorner',
|
181 | 179 |
Extends: Layout.HotCorner,
|
182 | |
@@ -305,7 +436,7 @@ const ApplicationsButton = new Lang.Clas
|
|
180 |
@@ -305,7 +434,7 @@ const ApplicationsButton = new Lang.Clas
|
183 | 181 |
_installedChangedId = appSys.connect('installed-changed', Lang.bind(this, function() {
|
184 | 182 |
if (this.menu.isOpen) {
|
185 | 183 |
this._redisplay();
|
|
188 | 186 |
} else {
|
189 | 187 |
this.reloadFlag = true;
|
190 | 188 |
}
|
191 | |
@@ -370,18 +501,19 @@ const ApplicationsButton = new Lang.Clas
|
|
189 |
@@ -370,18 +499,19 @@ const ApplicationsButton = new Lang.Clas
|
192 | 190 |
this._redisplay();
|
193 | 191 |
this.reloadFlag = false;
|
194 | 192 |
}
|
|
202 | 200 |
_redisplay: function() {
|
203 | 201 |
this.applicationsBox.destroy_all_children();
|
204 | 202 |
- this.categoriesBox.destroy_all_children();
|
205 | |
+ this.categoriesBox.actor.destroy_all_children();
|
|
203 |
+ this.categoriesBox.box.destroy_all_children();
|
206 | 204 |
this._display();
|
207 | 205 |
},
|
208 | 206 |
|
|
211 | 209 |
let iter = dir.iter();
|
212 | 210 |
let nextType;
|
213 | 211 |
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
|
214 | |
@@ -391,12 +523,21 @@ const ApplicationsButton = new Lang.Clas
|
|
212 |
@@ -391,12 +521,21 @@ const ApplicationsButton = new Lang.Clas
|
215 | 213 |
let app = appSys.lookup_app(entry.get_desktop_file_id());
|
216 | 214 |
if (appInfo.should_show()) {
|
217 | 215 |
let menu_id = dir.get_menu_id();
|
|
236 | 234 |
}
|
237 | 235 |
}
|
238 | 236 |
},
|
239 | |
@@ -417,8 +558,8 @@ const ApplicationsButton = new Lang.Clas
|
|
237 |
@@ -417,8 +556,8 @@ const ApplicationsButton = new Lang.Clas
|
240 | 238 |
},
|
241 | 239 |
|
242 | 240 |
scrollToCatButton: function(button) {
|
|
247 | 245 |
let currentScrollValue = catsScrollBoxAdj.get_value();
|
248 | 246 |
let boxHeight = catsScrollBoxAlloc.y2 - catsScrollBoxAlloc.y1;
|
249 | 247 |
let buttonAlloc = button.actor.get_allocation_box();
|
250 | |
@@ -432,10 +573,16 @@ const ApplicationsButton = new Lang.Clas
|
|
248 |
@@ -432,10 +571,16 @@ const ApplicationsButton = new Lang.Clas
|
251 | 249 |
},
|
252 | 250 |
|
253 | 251 |
_createLayout: function() {
|
|
266 | 264 |
this.applicationsScrollBox = new St.ScrollView({ x_fill: true, y_fill: false,
|
267 | 265 |
y_align: St.Align.START,
|
268 | 266 |
style_class: 'apps-menu vfade' });
|
269 | |
@@ -447,41 +594,52 @@ const ApplicationsButton = new Lang.Clas
|
|
267 |
@@ -447,41 +592,52 @@ const ApplicationsButton = new Lang.Clas
|
270 | 268 |
vscroll.connect('scroll-stop', Lang.bind(this, function() {
|
271 | 269 |
this.menu.passEvents = false;
|
272 | 270 |
}));
|
|
343 | 341 |
|
344 | 342 |
//Load categories
|
345 | 343 |
this.applicationsByCategory = {};
|
346 | |
@@ -489,7 +647,7 @@ const ApplicationsButton = new Lang.Clas
|
|
344 |
@@ -489,7 +645,7 @@ const ApplicationsButton = new Lang.Clas
|
347 | 345 |
tree.load_sync();
|
348 | 346 |
let root = tree.get_root_directory();
|
349 | 347 |
let categoryMenuItem = new CategoryMenuItem(this, null);
|
|
352 | 350 |
let iter = root.iter();
|
353 | 351 |
let nextType;
|
354 | 352 |
while ((nextType = iter.next()) != GMenu.TreeItemType.INVALID) {
|
355 | |
@@ -498,10 +656,12 @@ const ApplicationsButton = new Lang.Clas
|
|
353 |
@@ -498,10 +654,12 @@ const ApplicationsButton = new Lang.Clas
|
356 | 354 |
if (!dir.get_is_nodisplay()) {
|
357 | 355 |
let categoryId = dir.get_menu_id();
|
358 | 356 |
this.applicationsByCategory[categoryId] = [];
|
|
369 | 367 |
}
|
370 | 368 |
}
|
371 | 369 |
}
|
372 | |
@@ -510,8 +670,9 @@ const ApplicationsButton = new Lang.Clas
|
|
370 |
@@ -510,8 +668,9 @@ const ApplicationsButton = new Lang.Clas
|
373 | 371 |
//Load applications
|
374 | 372 |
this._displayButtons(this._listApplications(null));
|
375 | 373 |
|