From: Christian Dywan Date: Wed, 22 Apr 2009 21:54:55 +0000 (+0200) Subject: Fix toggling of Colourful Tabs X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=023abc9c72106b533eafd5b4c611afb823b5a3a6;p=midori Fix toggling of Colourful Tabs --- diff --git a/extensions/colorful-tabs.c b/extensions/colorful-tabs.c index 6d8a46e5..0cd76368 100644 --- a/extensions/colorful-tabs.c +++ b/extensions/colorful-tabs.c @@ -11,15 +11,6 @@ #include -static void -colorful_tabs_button_toggled_cb (GtkWidget* button, - MidoriExtension* extension) -{ - midori_extension_set_boolean (extension, "tint", - !midori_extension_get_boolean (extension, "tint")); - /* FIXME: Update all tab colors */ -} - static void colorful_tabs_view_notify_uri_cb (MidoriView* view, GParamSpec* pspec, @@ -70,6 +61,25 @@ colorful_tabs_view_notify_uri_cb (MidoriView* view, } } +static void +colorful_tabs_browser_foreach_cb (GtkWidget* view, + MidoriExtension* extension) +{ + colorful_tabs_view_notify_uri_cb (MIDORI_VIEW (view), NULL, extension); +} + +static void +colorful_tabs_button_toggled_cb (GtkWidget* button, + MidoriExtension* extension) +{ + MidoriBrowser* browser = MIDORI_BROWSER (gtk_widget_get_toplevel (button)); + + midori_extension_set_boolean (extension, "tint", + !midori_extension_get_boolean (extension, "tint")); + midori_browser_foreach (browser, + (GtkCallback)colorful_tabs_browser_foreach_cb, extension); +} + static void colorful_tabs_browser_add_tab_cb (MidoriBrowser* browser, MidoriView* view, @@ -83,11 +93,12 @@ static void colorful_tabs_deactivate_cb (MidoriExtension* extension, GtkWidget* bbox) { - gtk_widget_destroy (bbox); g_signal_handlers_disconnect_by_func ( extension, colorful_tabs_deactivate_cb, bbox); /* FIXME: Disconnect signals */ - /* FIXME: Reset all tab colors */ + midori_browser_foreach (MIDORI_BROWSER (gtk_widget_get_toplevel (bbox)), + (GtkCallback)colorful_tabs_browser_foreach_cb, extension); + gtk_widget_destroy (bbox); } static void