summaryrefslogtreecommitdiffhomepage
path: root/mixgtk
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2020-10-18 22:56:55 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2020-10-18 22:56:55 +0100
commit969855ee4936fd32e845b4fa6d0c3f8507425ca5 (patch)
treef1b263974830abffe738b79824e4ae43992ea801 /mixgtk
parentc003ec700123c601a66cb972d691b52aa978c361 (diff)
downloadmdk-969855ee4936fd32e845b4fa6d0c3f8507425ca5.tar.gz
mdk-969855ee4936fd32e845b4fa6d0c3f8507425ca5.tar.bz2
Show/hide toolbars
Diffstat (limited to 'mixgtk')
-rw-r--r--mixgtk/mixgtk_wm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c
index 2f96bba..24af568 100644
--- a/mixgtk/mixgtk_wm.c
+++ b/mixgtk/mixgtk_wm.c
@@ -41,7 +41,6 @@ typedef struct window_info_t_
const gchar *menu_name;
const gchar *config_key;
const gchar *toolbar_name;
- const gchar *handle_name;
gboolean detached;
void (*detach) (void);
void (*attach) (void);
@@ -92,13 +91,13 @@ static void on_nb_switch_ (GtkNotebook *notebook, GtkWidget *page,
static window_info_t_ infos_[] = {
{MIXGTK_MIXVM_DIALOG, NULL, NULL,
- "detach_vm", "MIX.detach", "mixvm_toolbar", "mixvm_tb_handle",
+ "detach_vm", "MIX.detach", "mixvm_toolbar",
FALSE, mixvm_detach_, mixvm_attach_},
{MIXGTK_MIXAL_DIALOG, NULL, NULL,
- "detach_source", "MIXAL.detach", "mixal_toolbar", "mixal_tb_handle",
+ "detach_source", "MIXAL.detach", "mixal_toolbar",
FALSE, mixal_detach_, mixal_attach_},
{MIXGTK_DEVICES_DIALOG, NULL, NULL,
- "detach_dev", "Devices.detach", "dev_toolbar", "dev_tb_handle",
+ "detach_dev", "Devices.detach", "dev_toolbar",
FALSE, dev_detach_, dev_attach_}
};
@@ -496,11 +495,11 @@ on_tb_style_ (GtkMenuItem *w, gpointer style)
mixgtk_config_set_tb_style (ui_style);
}
+static const gchar *TB_NAME = "main_toolbar";
+
static void
set_tb_style_ (guint style)
{
- static const gchar *TB_NAME = "main_toolbar";
-
gint k;
GtkToolbar *tb =
@@ -518,12 +517,10 @@ set_tb_style_ (guint style)
static void
show_toolbars_ (gboolean show)
{
- static const gchar *HANDLE_NAME = "tb_handle";
-
gint k;
GtkWidget *handle =
- mixgtk_widget_factory_get_child_by_name (HANDLE_NAME);
+ mixgtk_widget_factory_get_child_by_name (TB_NAME);
if (show)
gtk_widget_show (handle);
@@ -533,7 +530,7 @@ show_toolbars_ (gboolean show)
for (k = 0; k < INF_NO_; ++k)
{
GtkWidget *hd =
- mixgtk_widget_factory_get_child_by_name (infos_[k].handle_name);
+ mixgtk_widget_factory_get_child_by_name (infos_[k].toolbar_name);
if (show) gtk_widget_show (hd); else gtk_widget_hide (hd);
}