summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2014-05-25 16:38:05 +0200
committerFlorian Müllner <fmuellner@gnome.org>2014-05-27 19:49:04 +0200
commit38d8e465b37e06e935f6d5bbb9da05e1c171f426 (patch)
treee0ff579de6dd0740da6315c45e1132d9c6ce3234
parent5b3fb024be7298e803447cbd7de8bc0401830c19 (diff)
popupMenu: Hide separator label when not in use
The optional label support introduced in commit af063dc2f2ec broke the centering of separators, as the label still adds additional spacing even when empty. Properly hide the label actor in that case to fix the alignment. https://bugzilla.gnome.org/show_bug.cgi?id=730753
-rw-r--r--js/ui/popupMenu.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index af0d9e19..d7f3880c 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -251,8 +251,16 @@ const PopupSeparatorMenuItem = new Lang.Class({
this.actor.add(this.label);
this.actor.label_actor = this.label;
+ this.label.connect('notify::text',
+ Lang.bind(this, this._syncVisibility));
+ this._syncVisibility();
+
this._separator = new Separator.HorizontalSeparator({ style_class: 'popup-separator-menu-item' });
this.actor.add(this._separator.actor, { expand: true });
+ },
+
+ _syncVisibility: function() {
+ this.label.visible = this.label.text != '';
}
});