summaryrefslogtreecommitdiffhomepage
path: root/mixgtk/mixgtk_wm.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2008-03-16 18:22:16 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2008-03-16 18:22:16 +0100
commit4bddc7bafe5f7359b3df758b4626614567eef6c4 (patch)
treea120900e40e6e7d955d3a84bac8b0a0968102fa8 /mixgtk/mixgtk_wm.c
parent7fc4f77608e12d86298750cf9ad63d98695f2067 (diff)
downloadmdk-4bddc7bafe5f7359b3df758b4626614567eef6c4.tar.gz
mdk-4bddc7bafe5f7359b3df758b4626614567eef6c4.tar.bz2
Initial toolbar style set properly
Diffstat (limited to 'mixgtk/mixgtk_wm.c')
-rw-r--r--mixgtk/mixgtk_wm.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c
index 6534eea..749ecb6 100644
--- a/mixgtk/mixgtk_wm.c
+++ b/mixgtk/mixgtk_wm.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_wm.c :
* Implementation of the functions declared in mixgtk_wm.h
* ------------------------------------------------------------------
- * Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -72,6 +72,7 @@ static void init_visibility_ (void);
static void init_tb_ (void);
static void init_about_ (void);
static void init_autosave_ (void);
+static void set_tb_style_ (guint style);
static void show_toolbars_ (gboolean show);
static void add_page_ (GtkWidget *w, mixgtk_window_id_t id);
static void mixvm_attach_ (void);
@@ -440,7 +441,7 @@ init_tb_ (void)
{
gchar *names[4];
gint k;
- gint tb_style = mixgtk_config_tb_style ();
+ gint style = mixgtk_config_tb_style ();
tb_menu_ = GTK_CHECK_MENU_ITEM
(mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN,
@@ -473,34 +474,37 @@ init_tb_ (void)
g_signal_connect (G_OBJECT (item),
"activate",
G_CALLBACK (on_tb_style_), GUINT_TO_POINTER (k));
- if (k == tb_style)
- {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
- }
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), (k == style));
}
+ set_tb_style_ (style);
}
static void
on_tb_style_ (GtkMenuItem *w, gpointer style)
{
+ guint ui_style = GPOINTER_TO_UINT (style);
+ set_tb_style_ (ui_style);
+ mixgtk_config_set_tb_style (ui_style);
+}
+
+static void
+set_tb_style_ (guint style)
+{
static const gchar *TB_NAME = "main_toolbar";
static const gchar *TB_DNAME = "dlg_toolbar";
- guint ui_style = GPOINTER_TO_UINT (style);
gint k;
GtkToolbar *tb = GTK_TOOLBAR
(mixgtk_widget_factory_get_child_by_name (MIXGTK_MAIN, TB_NAME));
- gtk_toolbar_set_style (tb, ui_style);
+ gtk_toolbar_set_style (tb, style);
for (k = 0; k < INF_NO_; ++k)
{
GtkToolbar *tb = GTK_TOOLBAR
(mixgtk_widget_factory_get_child_by_name (infos_[k].dialog, TB_DNAME));
- gtk_toolbar_set_style (tb, ui_style);
+ gtk_toolbar_set_style (tb, style);
}
-
- mixgtk_config_set_tb_style (ui_style);
}
static void