summaryrefslogtreecommitdiff
path: root/gtk/gtkdialog.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-03-21 15:41:13 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-03-21 15:41:13 -0400
commit6e4567e73bceb66200b9605c51b4b5ad6e807483 (patch)
tree6e1449b58c4b4c2e03e05fb204eb9d82461e8f53 /gtk/gtkdialog.c
parent9ed2c8a71988079f94a204d2e7d19d3bcad5c933 (diff)
downloadgtk+-6e4567e73bceb66200b9605c51b4b5ad6e807483.tar.gz
Don't let themes override explicit border-width in dialogs
This fixes an issue where the theme-provided border-width prevents dialog contents from lining up properly with the headerbar.
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r--gtk/gtkdialog.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index d32a6570a7..d95be7132d 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -35,6 +35,7 @@
#include "gtkmarshalers.h"
#include "gtkbox.h"
#include "gtkboxprivate.h"
+#include "gtkcontainerprivate.h"
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkbindings.h"
@@ -566,6 +567,15 @@ gtk_dialog_class_init (GtkDialogClass *class)
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ /**
+ * GtkDialog:content-area-border:
+ *
+ * The default border width used around the
+ * content area of the dialog, as returned by
+ * gtk_dialog_get_content_area(), unless gtk_container_set_border_width()
+ * was called on that widget directly.
+ *
+ */
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("content-area-border",
P_("Content area border"),
@@ -656,9 +666,11 @@ update_spacings (GtkDialog *dialog)
"button-spacing", &button_spacing,
"action-area-border", &action_area_border,
NULL);
-
- gtk_container_set_border_width (GTK_CONTAINER (priv->vbox),
- content_area_border);
+
+ if (!_gtk_container_get_border_width_set (GTK_CONTAINER (priv->vbox)))
+ gtk_container_set_border_width (GTK_CONTAINER (priv->vbox),
+ content_area_border);
+
if (!_gtk_box_get_spacing_set (GTK_BOX (priv->vbox)))
{
gtk_box_set_spacing (GTK_BOX (priv->vbox), content_area_spacing);
@@ -667,8 +679,10 @@ update_spacings (GtkDialog *dialog)
gtk_box_set_spacing (GTK_BOX (priv->action_area),
button_spacing);
- gtk_container_set_border_width (GTK_CONTAINER (priv->action_area),
- action_area_border);
+
+ if (!_gtk_container_get_border_width_set (GTK_CONTAINER (priv->action_area)))
+ gtk_container_set_border_width (GTK_CONTAINER (priv->action_area),
+ action_area_border);
}
static void