diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-09-06 13:19:53 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-09-06 13:19:53 +0100 |
commit | 41b5b22e56892b7246f5bcfc270d685f052c0f70 (patch) | |
tree | bf285767d0633fc2666c895b0eda577f24823180 | |
parent | 0d231118f14f622ca025ac29db0b2cd0eeaec004 (diff) | |
download | ayatana-indicator-sound-41b5b22e56892b7246f5bcfc270d685f052c0f70.tar.gz ayatana-indicator-sound-41b5b22e56892b7246f5bcfc270d685f052c0f70.tar.bz2 ayatana-indicator-sound-41b5b22e56892b7246f5bcfc270d685f052c0f70.zip |
tried everything, the image will not show on the menu
-rw-r--r-- | src/indicator-sound.c | 4 | ||||
-rw-r--r-- | src/title-widget.c | 36 |
2 files changed, 31 insertions, 9 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c index 937ed68..4f954c3 100644 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -48,7 +48,6 @@ typedef struct _IndicatorSoundPrivate IndicatorSoundPrivate; struct _IndicatorSoundPrivate { GtkWidget* volume_widget; - //DbusmenuGtkMenu* menu; }; #define INDICATOR_SOUND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SOUND_TYPE, IndicatorSoundPrivate)) @@ -211,8 +210,6 @@ static GtkMenu * get_menu (IndicatorObject * io) { DbusmenuGtkMenu* menu = dbusmenu_gtkmenu_new(INDICATOR_SOUND_DBUS_NAME, INDICATOR_SOUND_DBUS_OBJECT); - //IndicatorSoundPrivate* priv = INDICATOR_SOUND_GET_PRIVATE(INDICATOR_SOUND (io)); - //priv->menu = menu; DbusmenuGtkClient *client = dbusmenu_gtkmenu_get_client(menu); g_object_set_data (G_OBJECT (client), "indicator", io); @@ -223,7 +220,6 @@ get_menu (IndicatorObject * io) dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_SCRUB_MENUITEM_TYPE, new_scrub_bar_widget); // register Key-press listening on the menu widget as the slider does not allow this. g_signal_connect(menu, "key-press-event", G_CALLBACK(key_press_cb), io); - //priv->menu = menu; return GTK_MENU(menu); } diff --git a/src/title-widget.c b/src/title-widget.c index 4b77cb2..d34dc7f 100644 --- a/src/title-widget.c +++ b/src/title-widget.c @@ -92,28 +92,54 @@ title_widget_init (TitleWidget *self) priv->hbox = hbox; // Add image to the 'gutter' - gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(self), TRUE); - + gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(self), TRUE); + gtk_image_menu_item_set_use_stock(GTK_IMAGE_MENU_ITEM(self), FALSE); + gint padding = 4; gtk_widget_style_get(GTK_WIDGET(self), "horizontal-padding", &padding, NULL); gint width, height; gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + g_debug("title widget init - height and weight = %i and %i", height, width); + + GtkImage * image = indicator_image_helper("sound_icon"); + GdkPixbuf* buf = gtk_image_get_pixbuf (image); + g_debug("Is it a pixbuf : %i", GDK_IS_PIXBUF(buf)); GtkWidget * icon = gtk_image_new_from_icon_name("sound_icon", GTK_ICON_SIZE_MENU); + + g_debug("title widget init - icon pixel size = %i", gtk_image_get_pixel_size (GTK_IMAGE(icon))); + g_debug("title widget init - image pixel size = %i", gtk_image_get_pixel_size (image)); gtk_widget_set_size_request(icon, width + 5 /* ref triangle is 5x9 pixels */ + 2 /* padding */, height); gtk_misc_set_alignment(GTK_MISC(icon), 1.0 /* right aligned */, 0.5); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(self), icon); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(self), GTK_WIDGET(image)); + gtk_widget_show_all(icon); + GtkWidget* returned_image = gtk_image_menu_item_get_image(GTK_IMAGE_MENU_ITEM(self)); + g_debug("returned image is not null %i", GTK_IS_IMAGE(returned_image)); // DEBUG - GtkImageType type = gtk_image_get_storage_type(GTK_IMAGE(icon)); - g_debug("gtk_image_storage_type = %i", type); + GtkImageType type; + type = gtk_image_get_storage_type(GTK_IMAGE(icon)); + g_debug("gtk_image_storage_type on widget = %i", type); + type = gtk_image_get_storage_type(image); + g_debug("gtk_image_storage_type on image = %i", type); + + gboolean* use_stock; + use_stock = g_new0(gboolean, 1); + gboolean* show_image; + show_image = g_new0(gboolean, 1); + + g_object_get(GTK_WIDGET(self), "use-stock", use_stock, NULL ); + g_object_get(GTK_WIDGET(self), "always-show-image", show_image, NULL); + g_debug("title widget init : use-stock = %i and show image = %i", *use_stock, *show_image); + g_free(use_stock); + g_free(show_image); } static void |