Revision: 4819 http://geany.svn.sourceforge.net/geany/?rev=4819&view=rev Author: eht16 Date: 2010-04-11 21:56:34 +0000 (Sun, 11 Apr 2010)
Log Message: ----------- Instantly update the toolbar icon size and style when the corresponding global GTK settings are changed.
Modified Paths: -------------- trunk/ChangeLog trunk/src/toolbar.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-04-11 21:56:23 UTC (rev 4818) +++ trunk/ChangeLog 2010-04-11 21:56:34 UTC (rev 4819) @@ -10,6 +10,9 @@ src/toolbar.c, src/toolbar.h: Shorten the toolbar popup menu, only provide items for Toolbar Preferences and to Hide the toolbar. + * src/toolbar.c: + Instantly update the toolbar icon size and style when the + corresponding global GTK settings are changed.
2010-04-09 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/src/toolbar.c =================================================================== --- trunk/src/toolbar.c 2010-04-11 21:56:23 UTC (rev 4818) +++ trunk/src/toolbar.c 2010-04-11 21:56:34 UTC (rev 4819) @@ -316,6 +316,24 @@ }
+static void toolbar_notify_style_cb(GObject *object, GParamSpec *arg1, gpointer data) +{ + const gchar *arg_name = g_param_spec_get_name(arg1); + gint value; + + if (toolbar_prefs.use_gtk_default_style && utils_str_equal(arg_name, "gtk-toolbar-style")) + { + value = ui_get_gtk_settings_integer(arg_name, toolbar_prefs.icon_style); + gtk_toolbar_set_style(GTK_TOOLBAR(main_widgets.toolbar), value); + } + else if (toolbar_prefs.use_gtk_default_icon && utils_str_equal(arg_name, "gtk-toolbar-size")) + { + value = ui_get_gtk_settings_integer(arg_name, toolbar_prefs.icon_size); + gtk_toolbar_set_icon_size(GTK_TOOLBAR(main_widgets.toolbar), value); + } +} + + GtkWidget *toolbar_init(void) { GtkWidget *toolbar; @@ -324,6 +342,7 @@ GtkAction *action_build; GtkAction *action_searchentry; GtkAction *action_gotoentry; + GtkSettings *gtk_settings;
uim = gtk_ui_manager_new(); group = gtk_action_group_new("GeanyToolbar"); @@ -375,6 +394,13 @@
toolbar = toolbar_reload(NULL);
+ gtk_settings = gtk_widget_get_settings(GTK_WIDGET(toolbar)); + if (gtk_settings != NULL) + { + g_signal_connect(gtk_settings, "notify::gtk-toolbar-style", + G_CALLBACK(toolbar_notify_style_cb), NULL); + } + return toolbar; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.