[gnome-shell] status/keyboard: Fix hidden separator when menu changes while open
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] status/keyboard: Fix hidden separator when menu changes while open
- Date: Tue, 18 Sep 2012 19:36:00 +0000 (UTC)
commit 5c7da4b0e6458432b851fbcdf55e01c713cd74c3
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Sep 18 12:17:58 2012 +0200
status/keyboard: Fix hidden separator when menu changes while open
Due to the way the IBus API works we might get property changes while
the menu is already open. In that case the separator visibility logic
doesn't work since it only applies on menu open/close. This works
around that issue.
https://bugzilla.gnome.org/show_bug.cgi?id=682314
js/ui/status/keyboard.js | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 27dac0c..d4fe7e4 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -210,7 +210,8 @@ const InputSourceIndicator = new Lang.Class({
this._currentSourceIndex = this._settings.get_uint(KEY_CURRENT_INPUT_SOURCE);
this._xkbInfo = new GnomeDesktop.XkbInfo();
- this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
+ this._propSeparator = new PopupMenu.PopupSeparatorMenuItem();
+ this.menu.addMenuItem(this._propSeparator);
this._propSection = new PopupMenu.PopupMenuSection();
this.menu.addMenuItem(this._propSection);
this._propSection.actor.hide();
@@ -445,13 +446,16 @@ const InputSourceIndicator = new Lang.Class({
},
_buildPropSection: function() {
+ this._propSeparator.actor.hide();
this._propSection.actor.hide();
this._propSection.removeAll();
this._buildPropSubMenu(this._propSection, this._properties);
- if (!this._propSection.isEmpty())
+ if (!this._propSection.isEmpty()) {
this._propSection.actor.show();
+ this._propSeparator.actor.show();
+ }
},
_buildPropSubMenu: function(menu, props) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]