diff options
-rw-r--r-- | src/stop-reload-button.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/stop-reload-button.c b/src/stop-reload-button.c index 7a006a3..a15b92f 100644 --- a/src/stop-reload-button.c +++ b/src/stop-reload-button.c @@ -28,8 +28,6 @@ struct _MqStopReloadButton { GtkToolButton parent_instance; - GtkWidget *stop_icon; - GtkWidget *reload_icon; MqWebView *web_view; }; @@ -46,14 +44,16 @@ 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_reload_button->stop_icon); + GTK_TOOL_BUTTON(stop_reload_button), stop_icon); gtk_tool_button_set_label( GTK_TOOL_BUTTON(stop_reload_button), "Stop"); gtk_widget_set_tooltip_text( @@ -61,8 +61,7 @@ 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), - stop_reload_button->reload_icon); + GTK_TOOL_BUTTON(stop_reload_button), reload_icon); gtk_tool_button_set_label( GTK_TOOL_BUTTON(stop_reload_button), "Reload"); gtk_widget_set_tooltip_text( @@ -147,24 +146,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_reload_button->stop_icon = gtk_image_new_from_icon_name( + stop_icon = gtk_image_new_from_icon_name( "process-stop", GTK_ICON_SIZE_SMALL_TOOLBAR); - g_object_ref_sink(stop_reload_button->stop_icon); + g_object_ref_sink(stop_icon); /* Reload icon */ - stop_reload_button->reload_icon = gtk_image_new_from_icon_name( + reload_icon = gtk_image_new_from_icon_name( "view-refresh", GTK_ICON_SIZE_SMALL_TOOLBAR); - g_object_ref_sink(stop_reload_button->reload_icon); + g_object_ref_sink(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_reload_button->stop_icon); + 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"); |