[Xfce4-commits] [panel-plugins/xfce4-mpc-plugin] 04/05: Create an empty GtkImage instead of using xfce_panel_image_new_from_source()

noreply at xfce.org noreply at xfce.org
Tue Nov 1 15:28:43 CET 2016


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-mpc-plugin.

commit 12edfe2734347a8d1c48b46fff8fb7d163f2c450
Author: Landry Breuil <landry at xfce.org>
Date:   Tue Nov 1 15:25:55 2016 +0100

    Create an empty GtkImage instead of using xfce_panel_image_new_from_source()
    
    Store the icon name and image in GObject, this way the icon will be loaded with
    the proper size upon widget resize event.
---
 panel-plugin/xfce4-mpc-plugin.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-mpc-plugin.c b/panel-plugin/xfce4-mpc-plugin.c
index 5af370d..ee9300b 100644
--- a/panel-plugin/xfce4-mpc-plugin.c
+++ b/panel-plugin/xfce4-mpc-plugin.c
@@ -702,7 +702,9 @@ static GtkWidget*
 new_button_with_cbk(XfcePanelPlugin * plugin, GtkWidget *parent, gchar* icon, gpointer cb, gpointer data)
 {
    GtkWidget *button = xfce_panel_create_button();
-   GtkWidget *image = xfce_panel_image_new_from_source(icon);
+   GtkWidget *image = gtk_image_new();
+   g_object_set_data(G_OBJECT(image), "icon-name", icon);
+   g_object_set_data(G_OBJECT(button), "image", image);
    gtk_container_add(GTK_CONTAINER(button), image);
    xfce_panel_plugin_add_action_widget (plugin, button);
    g_signal_connect (G_OBJECT(button), "button_press_event", G_CALLBACK(cb), data);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list