diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-01-17 06:26:45 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-01-17 06:26:45 -0500 |
commit | c8df255adc6cc00cee059b758bd7eb4b91e1b14e (patch) | |
tree | bbe618cf0bce593fb21ed74892ecb33fffaca91b | |
parent | e25f54dad3d79eea15fc1d18d9e549be5ecedf37 (diff) | |
download | gtk+-dialogs.tar.gz |
Add a warning if content is added to the action areadialogs
We also show the action area in this case, to avoid broken
situations.
-rw-r--r-- | gtk/gtkdialog.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 834aa86e51..bb0fe97d27 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -247,6 +247,7 @@ set_use_header_bar (GtkDialog *dialog, priv->use_header_bar = use_header_bar; } +/* A convenience helper for built-in dialogs */ void gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog) { @@ -260,8 +261,15 @@ gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog) } static void -add_cb (GtkContainer *container, GtkWidget *widget) +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)); } @@ -278,7 +286,7 @@ apply_use_header_bar (GtkDialog *dialog) 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", add_cb, NULL); + g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), dialog); } static void |