From 0f3866849d63cbb7b3dfd548f7d260443efd5660 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 13 Oct 2017 04:13:01 -0400 Subject: Revert "MqStopReloadButton: Make icons static" This reverts commit ea01dcb136267b99ec6fcd280d0c5d8efdeb8181. --- (limited to 'src') diff --git a/src/stop-reload-button.c b/src/stop-reload-button.c index a15b92f..7a006a3 100644 --- a/src/stop-reload-button.c +++ b/src/stop-reload-button.c @@ -28,6 +28,8 @@ struct _MqStopReloadButton { GtkToolButton parent_instance; + GtkWidget *stop_icon; + GtkWidget *reload_icon; MqWebView *web_view; }; @@ -44,16 +46,14 @@ struct _MqStopReloadButtonClass { G_DEFINE_TYPE(MqStopReloadButton, mq_stop_reload_button, GTK_TYPE_TOOL_BUTTON) -static GtkWidget *stop_icon = NULL; -static GtkWidget *reload_icon = NULL; - static void loading_cb(MqWebView *web_view, GParamSpec G_GNUC_UNUSED *paramspec, MqStopReloadButton *stop_reload_button) { if (webkit_web_view_is_loading(WEBKIT_WEB_VIEW(web_view))) { gtk_tool_button_set_icon_widget( - GTK_TOOL_BUTTON(stop_reload_button), stop_icon); + GTK_TOOL_BUTTON(stop_reload_button), + stop_reload_button->stop_icon); gtk_tool_button_set_label( GTK_TOOL_BUTTON(stop_reload_button), "Stop"); gtk_widget_set_tooltip_text( @@ -61,7 +61,8 @@ loading_cb(MqWebView *web_view, GParamSpec G_GNUC_UNUSED *paramspec, "Stop loading the current page"); } else { gtk_tool_button_set_icon_widget( - GTK_TOOL_BUTTON(stop_reload_button), reload_icon); + GTK_TOOL_BUTTON(stop_reload_button), + stop_reload_button->reload_icon); gtk_tool_button_set_label( GTK_TOOL_BUTTON(stop_reload_button), "Reload"); gtk_widget_set_tooltip_text( @@ -146,24 +147,24 @@ mq_stop_reload_button_class_init(MqStopReloadButtonClass *klass) G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB); g_object_class_install_properties(object_class, N_PROPERTIES, obj_properties); +} +static void +mq_stop_reload_button_init(MqStopReloadButton *stop_reload_button) +{ /* Stop icon */ - stop_icon = gtk_image_new_from_icon_name( + stop_reload_button->stop_icon = gtk_image_new_from_icon_name( "process-stop", GTK_ICON_SIZE_SMALL_TOOLBAR); - g_object_ref_sink(stop_icon); + g_object_ref_sink(stop_reload_button->stop_icon); /* Reload icon */ - reload_icon = gtk_image_new_from_icon_name( + stop_reload_button->reload_icon = gtk_image_new_from_icon_name( "view-refresh", GTK_ICON_SIZE_SMALL_TOOLBAR); - g_object_ref_sink(reload_icon); -} + g_object_ref_sink(stop_reload_button->reload_icon); -static void -mq_stop_reload_button_init(MqStopReloadButton *stop_reload_button) -{ /* Button */ gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(stop_reload_button), - stop_icon); + stop_reload_button->stop_icon); gtk_tool_button_set_label(GTK_TOOL_BUTTON(stop_reload_button), "Stop"); gtk_widget_set_tooltip_text(GTK_WIDGET(stop_reload_button), "Stop loading the current page"); -- cgit v0.9.1