From 09670630c062d52a6926ef58cea90c1ec8b42c0f Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 19 Oct 2020 00:06:51 +0100 Subject: attach/detach buttons --- mixgtk/mixgtk.glade | 10 +++++----- mixgtk/mixgtk_wm.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mixgtk/mixgtk.glade b/mixgtk/mixgtk.glade index f245c16..35e0147 100644 --- a/mixgtk/mixgtk.glade +++ b/mixgtk/mixgtk.glade @@ -569,7 +569,7 @@ Free Software Foundation, Inc</small> - + True False True @@ -1674,7 +1674,7 @@ Free Software Foundation, Inc</small> True Attach True - gtk-dnd + gtk-revert-to-saved @@ -1893,7 +1893,7 @@ Free Software Foundation, Inc</small> - + True False True @@ -1965,7 +1965,7 @@ Free Software Foundation, Inc</small> True Font True - gtk-disconnect + gtk-select-font @@ -1984,7 +1984,7 @@ Free Software Foundation, Inc</small> - + attach_button True False diff --git a/mixgtk/mixgtk_wm.c b/mixgtk/mixgtk_wm.c index f1cf8d7..b442eb9 100644 --- a/mixgtk/mixgtk_wm.c +++ b/mixgtk/mixgtk_wm.c @@ -41,6 +41,7 @@ typedef struct window_info_t_ const gchar *menu_name; const gchar *config_key; const gchar *toolbar_name; + const gchar *attach_button; gboolean detached; void (*detach) (void); void (*attach) (void); @@ -91,13 +92,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", + "detach_vm", "MIX.detach", "mixvm_toolbar", "attach_button_mixvm", FALSE, mixvm_detach_, mixvm_attach_}, {MIXGTK_MIXAL_DIALOG, NULL, NULL, - "detach_source", "MIXAL.detach", "mixal_toolbar", + "detach_source", "MIXAL.detach", "mixal_toolbar", "attach_button_mixal", FALSE, mixal_detach_, mixal_attach_}, {MIXGTK_DEVICES_DIALOG, NULL, NULL, - "detach_dev", "Devices.detach", "dev_toolbar", + "detach_dev", "Devices.detach", "dev_toolbar", "attach_button_dev", FALSE, dev_detach_, dev_attach_} }; @@ -313,8 +314,7 @@ init_signals_ (void) G_OBJECT (mixgtk_widget_factory_get_dialog (infos_[k].dialog)); GObject *button = - G_OBJECT (mixgtk_widget_factory_get (infos_[k].dialog, - MIXGTK_WIDGET_ATTACH_BUTTON)); + G_OBJECT (mixgtk_widget_factory_get_by_name (infos_[k].attach_button)); g_assert (dialog != NULL); g_assert (button != NULL); @@ -573,8 +573,7 @@ mixvm_attach_ (void) static void reparent_ (GtkWidget *widget, GtkWidget *parent) { - gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (widget)), - widget); + gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (widget)), widget); gtk_container_add (GTK_CONTAINER (parent), widget); } @@ -636,6 +635,7 @@ dev_detach_ (void) reparent_ (infos_[MIXGTK_DEVICES_WINDOW].widget, GTK_WIDGET (dev_container_)); } + static void on_nb_switch_ (GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data) -- cgit v1.2.3