diff options
author | Ted Gould <ted@gould.cx> | 2010-03-30 21:58:45 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-30 21:58:45 -0500 |
commit | b8013ea21382428e7b4fcd3b7cf874dd01bee941 (patch) | |
tree | f0faac99dc01bf74832fc87f3333db5459a9963b | |
parent | ee6bc3c94baf3d985de68e4f6ca1c2d30ab8d811 (diff) | |
download | ayatana-indicator-messages-b8013ea21382428e7b4fcd3b7cf874dd01bee941.tar.gz ayatana-indicator-messages-b8013ea21382428e7b4fcd3b7cf874dd01bee941.tar.bz2 ayatana-indicator-messages-b8013ea21382428e7b4fcd3b7cf874dd01bee941.zip |
Make the visibility of indictor items and separators follow the visibility of the application item.
-rw-r--r-- | src/messages-service.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 8321406..515e8b3 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -904,6 +904,13 @@ resort_menu (DbusmenuMenuitem * menushell) if (imi->menuitem != NULL) { g_debug("\tMoving indicator on %s id %d to position %d", INDICATE_LISTENER_SERVER_DBUS_NAME(imi->server), INDICATE_LISTENER_INDICATOR_ID(imi->indicator), position); + + if (si->menuitem == NULL || !dbusmenu_menuitem_property_get_bool(DBUSMENU_MENUITEM(si->menuitem), DBUSMENU_MENUITEM_PROP_VISIBLE)) { + dbusmenu_menuitem_property_set_bool(imi->menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + } else { + dbusmenu_menuitem_property_set_bool(imi->menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + } + dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(imi->menuitem), position); position++; } @@ -912,10 +919,17 @@ resort_menu (DbusmenuMenuitem * menushell) /* Lastly putting the separator in */ if (si->separator != NULL) { g_debug("\tMoving app %s separator to position %d", INDICATE_LISTENER_SERVER_DBUS_NAME(si->server), position); + + if (si->menuitem == NULL || !dbusmenu_menuitem_property_get_bool(DBUSMENU_MENUITEM(si->menuitem), DBUSMENU_MENUITEM_PROP_VISIBLE)) { + dbusmenu_menuitem_property_set_bool(si->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + /* Note, this isn't the last if we can't see it */ + } else { + dbusmenu_menuitem_property_set_bool(si->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + last_separator = si->separator; + } + dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(si->separator), position); - dbusmenu_menuitem_property_set_bool(si->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); position++; - last_separator = si->separator; } } |