[gnome-shell/wip/aggregate-menu: 56/69] panelMenu: Show/hide the indicators box based on indicator visibility
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/aggregate-menu: 56/69] panelMenu: Show/hide the indicators box based on indicator visibility
- Date: Fri, 26 Jul 2013 04:36:42 +0000 (UTC)
commit 3c98f160d38075e3cccf3f3cfe47a287877e3eda
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Jul 15 19:46:25 2013 -0400
panelMenu: Show/hide the indicators box based on indicator visibility
This ensures that there's no empty space in the indicators box, and we don't
have to manage it manually.
js/ui/panelMenu.js | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/panelMenu.js b/js/ui/panelMenu.js
index 5dd8d44..64049d5 100644
--- a/js/ui/panelMenu.js
+++ b/js/ui/panelMenu.js
@@ -246,13 +246,22 @@ const SystemIndicator = new Lang.Class({
_init: function() {
this.indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box',
reactive: true });
+ this.indicators.hide();
this.menu = new PopupMenu.PopupMenuSection();
},
+ _syncIndicatorsVisible: function() {
+ this.indicators.visible = this.indicators.get_children().some(function(actor) {
+ return actor.visible;
+ });
+ },
+
addIndicator: function(gicon) {
let icon = new St.Icon({ gicon: gicon,
style_class: 'system-status-icon' });
this.indicators.add_actor(icon);
+ icon.connect('notify::visible', Lang.bind(this, this._syncIndicatorsVisible));
+ this._syncIndicatorsVisible();
return icon;
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]