mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 15:14:17 +00:00
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.
This commit is contained in:
parent
c6ae9e6b47
commit
54b1419952
@ -258,6 +258,19 @@ gtk_dialog_set_use_header_bar_from_setting (GtkDialog *dialog)
|
||||
NULL);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user