[gtk+] dialogs: always use CSD on dialogs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] dialogs: always use CSD on dialogs
- Date: Mon, 3 Mar 2014 20:00:27 +0000 (UTC)
commit 322f6c740f631abc24cc26fa2b81307eae18ef2c
Author: William Jon McCann <william jon mccann gmail com>
Date: Thu Feb 27 14:19:32 2014 -0500
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
gtk/gtkdialog.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 8e5797f..37d9bf0 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]