dialogs: always use CSD on dialogs

If we aren't using a header bar then put a fake titlebar
box on it so we can round the corners.

One of the advantages of this is so that the styling of the dialog
is completely within one theme framework. This prevents skew between
the theming expectations from the window manager and GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=725345
This commit is contained in:
William Jon McCann
2014-02-27 14:19:32 -05:00
committed by Matthias Clasen
parent 9ce98deb25
commit 322f6c740f

View File

@@ -279,7 +279,18 @@ apply_use_header_bar (GtkDialog *dialog)
gtk_widget_set_visible (priv->action_area, !priv->use_header_bar);
gtk_widget_set_visible (priv->headerbar, priv->use_header_bar);
if (!priv->use_header_bar)
gtk_window_set_titlebar (GTK_WINDOW (dialog), NULL);
{
GtkWidget *box = NULL;
if (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_WINDOW_TYPE_HINT_DIALOG)
{
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (box);
gtk_widget_set_size_request (box, -1, 16);
}
gtk_window_set_titlebar (GTK_WINDOW (dialog), box);
}
if (priv->use_header_bar)
g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), dialog);
}