diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-01-14 23:59:20 +0100 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-01-14 23:59:20 +0100 |
commit | 3540dc7d8fd0ef1f6b27c3c39760d0442912c2b1 (patch) | |
tree | 62e03708bec415972980c6099a4546d3efff44a1 /src | |
parent | 1e56f31341ecdb60456929a3d6d07bb16409b399 (diff) | |
download | ayatana-indicator-printers-3540dc7d8fd0ef1f6b27c3c39760d0442912c2b1.tar.gz ayatana-indicator-printers-3540dc7d8fd0ef1f6b27c3c39760d0442912c2b1.tar.bz2 ayatana-indicator-printers-3540dc7d8fd0ef1f6b27c3c39760d0442912c2b1.zip |
indicator-menu-item: add get / set and notify signal for right_is_lozenge
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-menu-item.c | 25 | ||||
-rw-r--r-- | src/indicator-menu-item.h | 2 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/indicator-menu-item.c b/src/indicator-menu-item.c index afdf980..a41177d 100644 --- a/src/indicator-menu-item.c +++ b/src/indicator-menu-item.c @@ -139,8 +139,6 @@ indicator_menu_item_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - IndicatorMenuItemPrivate *priv = MENU_ITEM_PRIVATE (object); - switch (property_id) { case PROP_ICON: @@ -164,8 +162,8 @@ indicator_menu_item_set_property (GObject *object, break; case PROP_RIGHT_IS_LOZENGE: - priv->right_is_lozenge = g_value_get_boolean (value); - gtk_widget_queue_draw (priv->right_label); + indicator_menu_item_set_right_is_lozenge (INDICATOR_MENU_ITEM (object), + g_value_get_boolean (value)); break; @@ -305,6 +303,25 @@ indicator_menu_item_set_right (IndicatorMenuItem *self, } +gboolean +indicator_menu_item_get_right_is_lozenge (IndicatorMenuItem *self) +{ + IndicatorMenuItemPrivate *priv = MENU_ITEM_PRIVATE (self); + return priv->right_is_lozenge; +} + + +void +indicator_menu_item_set_right_is_lozenge (IndicatorMenuItem *self, + gboolean is_lozenge) +{ + IndicatorMenuItemPrivate *priv = MENU_ITEM_PRIVATE (self); + priv->right_is_lozenge = is_lozenge; + gtk_widget_queue_draw (priv->right_label); + g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_RIGHT_IS_LOZENGE]); +} + + GdkPixbuf * indicator_menu_item_get_icon (IndicatorMenuItem *self) { diff --git a/src/indicator-menu-item.h b/src/indicator-menu-item.h index a5f3407..e577a7d 100644 --- a/src/indicator-menu-item.h +++ b/src/indicator-menu-item.h @@ -48,6 +48,8 @@ IndicatorMenuItem *indicator_menu_item_new (void); void indicator_menu_item_set_right (IndicatorMenuItem *self, const gchar *text); void indicator_menu_item_set_label (IndicatorMenuItem *self, const gchar *text); +gboolean indicator_menu_item_get_right_is_lozenge (IndicatorMenuItem *self); +void indicator_menu_item_set_right_is_lozenge (IndicatorMenuItem *self, gboolean is_lozenge); const gchar * indicator_menu_item_get_icon_name (IndicatorMenuItem *self); void indicator_menu_item_set_icon (IndicatorMenuItem *self, GdkPixbuf *icon); GdkPixbuf * indicator_menu_item_get_icon (IndicatorMenuItem *self); |