[gtk+] dialog: Show the action area when needed



commit 54b14199520776fd285db6bd269f595be471e1fc
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 16 23:58:49 2014 -0500

    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.

 gtk/gtkdialog.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 90eeabc..fa52c77 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]