+2008-09-24 Christian Dywan <christian@imendio.com>
+
+ Bug 408244 – add GtkDialog::content-area-spacing
+
+ * gtk/gtkbox.c (gtk_box_init), (gtk_box_set_spacing),
+ (_gtk_box_set_spacing_set), (_gtk_box_get_spacing_set):
+ * gtk/gtkbox.h:
+ * gtk/gtkdialog.c (gtk_dialog_class_init), (update_spacings):
+ Implement "content-area-spacing" style property in GtkDialog
+ and internal helper _gtk_box_get_spacing_set in GtkBox.
+ Patch by Tim Janik, Sven Herzberg and myself.
+
2008-09-24 Christian Dywan <christian@imendio.com>
Bug 541391 – Unfocussable Treeview swallows focus
G_MAXINT,
0,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (gobject_class,
PROP_HOMOGENEOUS,
g_param_spec_boolean ("homogeneous",
box->children = NULL;
box->spacing = 0;
+ box->spacing_set = FALSE;
box->homogeneous = FALSE;
}
if (spacing != box->spacing)
{
box->spacing = spacing;
+ box->spacing_set = TRUE;
+
g_object_notify (G_OBJECT (box), "spacing");
+
gtk_widget_queue_resize (GTK_WIDGET (box));
}
}
return box->spacing;
}
+void
+_gtk_box_set_spacing_set (GtkBox *box,
+ gboolean spacing_set)
+{
+ g_return_if_fail (GTK_IS_BOX (box));
+
+ box->spacing_set = spacing_set;
+}
+
+gboolean
+_gtk_box_get_spacing_set (GtkBox *box)
+{
+ g_return_val_if_fail (GTK_IS_BOX (box), FALSE);
+
+ return box->spacing_set;
+}
+
/**
* gtk_box_reorder_child:
* @box: a #GtkBox
G_MAXINT,
2,
GTK_PARAM_READABLE));
+ /**
+ * GtkDialog:content-area-spacing:
+ *
+ * The default spacing used between elements of the
+ * content area of the dialog, as returned by
+ * gtk_dialog_get_content_area(), unless gtk_box_set_spacing()
+ * was called on that widget directly.
+ *
+ * Since: 2.16
+ */
+ gtk_widget_class_install_style_property (widget_class,
+ g_param_spec_int ("content-area-spacing",
+ P_("Content area spacing"),
+ P_("Spacing between elements of the main dialog area"),
+ 0,
+ G_MAXINT,
+ 0,
+ GTK_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("button-spacing",
P_("Button spacing"),
static void
update_spacings (GtkDialog *dialog)
{
- GtkWidget *widget;
gint content_area_border;
+ gint content_area_spacing;
gint button_spacing;
gint action_area_border;
-
- widget = GTK_WIDGET (dialog);
- gtk_widget_style_get (widget,
+ gtk_widget_style_get (GTK_WIDGET (dialog),
"content-area-border", &content_area_border,
+ "content-area-spacing", &content_area_spacing,
"button-spacing", &button_spacing,
"action-area-border", &action_area_border,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox),
content_area_border);
+ if (!_gtk_box_get_spacing_set (GTK_BOX (dialog->vbox)))
+ {
+ gtk_box_set_spacing (GTK_BOX (dialog->vbox), content_area_spacing);
+ _gtk_box_set_spacing_set (GTK_BOX (dialog->vbox), FALSE);
+ }
gtk_box_set_spacing (GTK_BOX (dialog->action_area),
button_spacing);
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area),