infobar: set default border/spacing on action/content areas

Commit cdf473ec10 deprecated the style
properties associated with the container border width and box spacing of
the action and content areas, in favour of using
gtk_container_set_border_width() and gtk_box_set_spacing() on the
widgets themselves, but failed to initialize those values to the
defaults.
This commit is contained in:
Cosimo Cecchi 2012-05-07 17:34:46 -04:00
parent 985881ffcc
commit a4d76439e6

View File

@ -145,6 +145,10 @@ enum
static guint signals[LAST_SIGNAL];
#define ACTION_AREA_DEFAULT_BORDER 5
#define ACTION_AREA_DEFAULT_SPACING 6
#define CONTENT_AREA_DEFAULT_BORDER 8
#define CONTENT_AREA_DEFAULT_SPACING 16
static void gtk_info_bar_set_property (GObject *object,
guint prop_id,
@ -467,7 +471,7 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
P_("Width of border around the content area"),
0,
G_MAXINT,
8,
CONTENT_AREA_DEFAULT_BORDER,
GTK_PARAM_READABLE));
/**
@ -485,7 +489,7 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
P_("Spacing between elements of the area"),
0,
G_MAXINT,
16,
CONTENT_AREA_DEFAULT_SPACING,
GTK_PARAM_READABLE));
/**
@ -502,7 +506,7 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
P_("Spacing between buttons"),
0,
G_MAXINT,
6,
ACTION_AREA_DEFAULT_SPACING,
GTK_PARAM_READABLE));
/**
@ -519,7 +523,7 @@ gtk_info_bar_class_init (GtkInfoBarClass *klass)
P_("Width of border around the action area"),
0,
G_MAXINT,
5,
ACTION_AREA_DEFAULT_BORDER,
GTK_PARAM_READABLE));
binding_set = gtk_binding_set_by_class (klass);
@ -557,6 +561,12 @@ gtk_info_bar_init (GtkInfoBar *info_bar)
info_bar->priv->content_area = content_area;
info_bar->priv->action_area = action_area;
/* set default spacings */
gtk_box_set_spacing (GTK_BOX (info_bar->priv->action_area), ACTION_AREA_DEFAULT_SPACING);
gtk_container_set_border_width (GTK_CONTAINER (info_bar->priv->action_area), ACTION_AREA_DEFAULT_BORDER);
gtk_box_set_spacing (GTK_BOX (info_bar->priv->content_area), CONTENT_AREA_DEFAULT_SPACING);
gtk_container_set_border_width (GTK_CONTAINER (info_bar->priv->content_area), CONTENT_AREA_DEFAULT_BORDER);
/* message-type is a CONSTRUCT property, so we init to a value
* different from its default to trigger its property setter
* during construction */