diff options
author | Ted Gould <ted@gould.cx> | 2010-02-17 12:50:12 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-17 12:50:12 -0600 |
commit | 5da2f0c0661f6d5ebced459ec677aa86441894b0 (patch) | |
tree | 1cfd8c802a936239b7b8591efe9691336c253690 | |
parent | 05436b2d6a483ea791b5a1ec396493ed08830b25 (diff) | |
download | ayatana-indicator-messages-5da2f0c0661f6d5ebced459ec677aa86441894b0.tar.gz ayatana-indicator-messages-5da2f0c0661f6d5ebced459ec677aa86441894b0.tar.bz2 ayatana-indicator-messages-5da2f0c0661f6d5ebced459ec677aa86441894b0.zip |
Applying the eclipsed value to the shortcuts that are associted with this launcher.
-rw-r--r-- | src/launcher-menu-item.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c index a65aed0..e961573 100644 --- a/src/launcher-menu-item.c +++ b/src/launcher-menu-item.c @@ -257,13 +257,32 @@ launcher_menu_item_get_description (LauncherMenuItem * li) return g_app_info_get_description(priv->appinfo); } +/* Apply the eclipse value to all the shortcuts */ +static void +eclipse_shortcuts_cb (gpointer data, gpointer user_data) +{ + DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(data); + g_return_if_fail(mi != NULL); + + gboolean eclipsed = GPOINTER_TO_UINT(user_data); + + dbusmenu_menuitem_property_set_bool(mi, DBUSMENU_MENUITEM_PROP_VISIBLE, !eclipsed); + return; +} + /* Hides the menu item based on whether it is eclipsed or not. */ void launcher_menu_item_set_eclipsed (LauncherMenuItem * li, gboolean eclipsed) { + g_return_if_fail(IS_LAUNCHER_MENU_ITEM(li)); + LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(li); + g_debug("Laucher '%s' is %s", launcher_menu_item_get_name(li), eclipsed ? "now eclipsed" : "shown again"); dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(li), DBUSMENU_MENUITEM_PROP_VISIBLE, !eclipsed); + + g_list_foreach(priv->shortcuts, eclipse_shortcuts_cb, GINT_TO_POINTER(eclipsed)); + return; } |