From feaaf39cf0602875c8a504d40cc7f8deb287fbc8 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 8 Sep 2019 23:59:47 +0100 Subject: fixup gtk2 ui builder for toolbar customisation --- frontends/gtk/res/toolbar.gtk2.ui | 194 +++++--------------------------------- frontends/gtk/res/toolbar.gtk3.ui | 132 +------------------------- frontends/gtk/toolbar.c | 11 ++- 3 files changed, 32 insertions(+), 305 deletions(-) diff --git a/frontends/gtk/res/toolbar.gtk2.ui b/frontends/gtk/res/toolbar.gtk2.ui index cb5e9ebe8..eb882f368 100644 --- a/frontends/gtk/res/toolbar.gtk2.ui +++ b/frontends/gtk/res/toolbar.gtk2.ui @@ -2,174 +2,7 @@ - - 700 - 450 - False - 5 - gtkToolBarTitle - center-on-parent - True - dialog - - - True - False - 2 - - - True - False - True - - - True - False - Move items from store to toolbar - - - True - True - 0 - - - - - True - False - Rearrange items in toolbar - - - True - True - 1 - - - - - True - False - Move items from toolbar to store - - - True - True - 2 - - - - - False - True - 2 - 0 - - - - - True - False - automatic - automatic - - - True - False - - - True - False - - - - - - - - - - True - True - 1 - - - - - True - False - end - - - True - True - False - - - True - False - - - True - False - gtk-refresh - - - False - True - 0 - - - - - True - False - Reset to defaults - - - True - True - 1 - - - - - - - False - True - 10 - 0 - - - - - gtk-close - True - True - True - True - - - False - False - 1 - - - - - False - True - 2 - - - - - - reset - close - - - + True False @@ -184,11 +17,28 @@ - + True - False + True + automatic + automatic - + + True + False + + + True + False + + + + + + + + + @@ -203,7 +53,7 @@ False end - + Reset to defaults True True diff --git a/frontends/gtk/res/toolbar.gtk3.ui b/frontends/gtk/res/toolbar.gtk3.ui index e74ddb02a..c8713bad4 100644 --- a/frontends/gtk/res/toolbar.gtk3.ui +++ b/frontends/gtk/res/toolbar.gtk3.ui @@ -3,140 +3,12 @@ - - 700 - 450 - False - gtkToolBarTitle - dialog - - - - - - False - vertical - 2 - - - False - end - - - Reset To Defaults - True - True - True - 0.52999997138977051 - True - - - True - True - 0 - - - - - gtk-close - True - True - True - True - - - True - True - 1 - - - - - False - False - 2 - - - - - True - False - True - - - True - False - Move items from store to toolbar - - - 0 - 0 - - - - - True - False - Rearrange items in toolbar - - - 1 - 0 - - - - - True - False - Move items from toolbar to store - - - 2 - 0 - - - - - False - True - 0 - - - - - True - True - - - True - False - - - True - False - - - - - - - - - - True - True - 2 - - - - - True False gtk-refresh - + True False vertical @@ -185,7 +57,7 @@ False end - + Reset True True diff --git a/frontends/gtk/toolbar.c b/frontends/gtk/toolbar.c index 3cd936cf2..7184ead14 100644 --- a/frontends/gtk/toolbar.c +++ b/frontends/gtk/toolbar.c @@ -2180,7 +2180,7 @@ static gboolean cutomize_button_clicked_cb(GtkWidget *widget, gpointer data) } /* get container box widget which forms a page of the tabs */ - tbc->container = GTK_WIDGET(gtk_builder_get_object(builder, "tabBox")); + tbc->container = GTK_WIDGET(gtk_builder_get_object(builder, "customisation")); if (tbc->container == NULL) { goto cutomize_button_clicked_cb_error; } @@ -2262,13 +2262,18 @@ static gboolean cutomize_button_clicked_cb(GtkWidget *widget, gpointer data) /* close and cleanup on destroy signal */ /* configure the container */ - gtk_window_set_accept_focus(GTK_WINDOW(tbc->container), FALSE); - gtk_drag_dest_set(GTK_WIDGET(tbc->container), GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, &target_entry, 1, GDK_ACTION_COPY); + + g_signal_connect_swapped(GTK_WIDGET(gtk_builder_get_object(builder, + "discard")), + "clicked", + G_CALLBACK(gtk_widget_destroy), + tbc->container); + #if 0 g_signal_connect(GTK_WIDGET(gtk_builder_get_object(builder, "close")), "clicked", -- cgit v1.2.3