diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-01-16 23:58:49 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-01-17 17:52:08 -0500 |
commit | 54b14199520776fd285db6bd269f595be471e1fc (patch) | |
tree | 60fdf8529b4bbd3c7498cd210c97d34d935aef09 /gtk/gtkdialog.c | |
parent | c6ae9e6b47b55c4ae1ae5a5bbf014c7207dc6f04 (diff) | |
download | gtk+-54b14199520776fd285db6bd269f595be471e1fc.tar.gz |
dialog: Show the action area when needed
If we find that widgets are being added to the action area,
we should show it. Also warn in this situation.
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r-- | gtk/gtkdialog.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 90eeabc1f9..fa52c77b25 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -259,6 +259,19 @@ gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog) } static void +add_cb (GtkContainer *container, + GtkWidget *widget, + GtkDialog *dialog) +{ + GtkDialogPrivate *priv = dialog->priv; + + if (priv->use_header_bar) + g_warning ("Content added to the action area of a dialog using header bars"); + + gtk_widget_show (GTK_WIDGET (container)); +} + +static void apply_use_header_bar (GtkDialog *dialog) { GtkDialogPrivate *priv = dialog->priv; @@ -267,6 +280,8 @@ apply_use_header_bar (GtkDialog *dialog) gtk_widget_set_visible (priv->headerbar, priv->use_header_bar); if (!priv->use_header_bar) gtk_window_set_titlebar (GTK_WINDOW (dialog), NULL); + if (priv->use_header_bar) + g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), dialog); } static void |