diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-11-12 18:00:37 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-11-12 18:00:37 +0000 |
commit | ee981578fa2261bdea4a3c6bd0beaf89e7ed11e8 (patch) | |
tree | 8cee8f7ba4f0a9422c434b3947575c4dcf6db68c | |
parent | 5fd2c5e12a059ab8c59306676d18dfc56c818077 (diff) | |
download | ayatana-indicator-sound-ee981578fa2261bdea4a3c6bd0beaf89e7ed11e8.tar.gz ayatana-indicator-sound-ee981578fa2261bdea4a3c6bd0beaf89e7ed11e8.tar.bz2 ayatana-indicator-sound-ee981578fa2261bdea4a3c6bd0beaf89e7ed11e8.zip |
icon loading now assumes there is an app name plus -panel lying around from the theme
-rw-r--r-- | src/title-widget.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/title-widget.c b/src/title-widget.c index 5bc2a93..73f846a 100644 --- a/src/title-widget.c +++ b/src/title-widget.c @@ -32,7 +32,7 @@ typedef struct _TitleWidgetPrivate TitleWidgetPrivate; struct _TitleWidgetPrivate { - DbusmenuMenuitem* twin_item; + DbusmenuMenuitem* twin_item; }; #define TITLE_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TITLE_WIDGET_TYPE, TitleWidgetPrivate)) @@ -83,25 +83,23 @@ title_widget_set_icon(TitleWidget *self) { TitleWidgetPrivate *priv = TITLE_WIDGET_GET_PRIVATE(self); - gchar* icon_name = g_strdup(dbusmenu_menuitem_property_get(priv->twin_item, - DBUSMENU_TITLE_MENUITEM_ICON)); gint padding = 0; gtk_widget_style_get(GTK_WIDGET(self), "horizontal-padding", &padding, NULL); gint width, height; gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); - - GtkWidget * icon = gtk_image_new_from_icon_name(icon_name, - GTK_ICON_SIZE_MENU); - - gtk_widget_set_size_request(icon, width + GString* app_panel = g_string_new ( g_utf8_strdown ( dbusmenu_menuitem_property_get(priv->twin_item, DBUSMENU_TITLE_MENUITEM_NAME), + -1 )); + g_string_append(app_panel, "-panel"); + GtkWidget * icon = gtk_image_new_from_icon_name( g_string_free ( app_panel, FALSE), + GTK_ICON_SIZE_MENU ); + gtk_widget_set_size_request(icon, width + 5 /* ref triangle is 5x9 pixels */ + 1 /* padding */, height); gtk_misc_set_alignment(GTK_MISC(icon), 0.5 /* right aligned */, 0); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(self), GTK_WIDGET(icon)); gtk_widget_show(icon); - g_free(icon_name); } static void |