Kaydet (Commit) 10bdf624 authored tarafından Enrico Tröger's avatar Enrico Tröger

Instantly update the toolbar icon size and style when the corresponding global…

Instantly update the toolbar icon size and style when the corresponding global GTK settings are changed.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4819 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst fef3ee8f
......@@ -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>
......
......@@ -316,6 +316,24 @@ static GtkWidget *toolbar_reload(const gchar *markup)
}
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 @@ GtkWidget *toolbar_init(void)
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 @@ GtkWidget *toolbar_init(void)
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment