GtkWidget *child;
GtkBorder default_border;
GtkBorder inner_border;
- GtkBorder *border;
+ GtkBorder padding;
gint focus_width;
gint focus_pad;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
+ gtk_button_get_props (button, &default_border, NULL, &inner_border, &padding, NULL);
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
- gtk_style_context_get (context, state,
- "border-width", &border,
- NULL);
-
gtk_widget_set_allocation (widget, allocation);
if (gtk_widget_get_realized (widget))
child = gtk_bin_get_child (GTK_BIN (button));
if (child && gtk_widget_get_visible (child))
{
- child_allocation.x = allocation->x + inner_border.left + border->left;
- child_allocation.y = allocation->y + inner_border.top + border->top;
+ child_allocation.x = allocation->x + inner_border.left + padding.left;
+ child_allocation.y = allocation->y + inner_border.top + padding.top;
child_allocation.width =
allocation->width -
- (border->left + border->right) -
+ (padding.left + padding.right) -
inner_border.left -
inner_border.right;
child_allocation.height =
allocation->height -
- (border->top + border->bottom) -
+ (padding.top + padding.bottom) -
inner_border.top -
inner_border.bottom;
gtk_widget_size_allocate (child, &child_allocation);
}
-
- gtk_border_free (border);
}
void
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
- gtk_button_get_props (button, &default_border, &default_outside_border, NULL, &interior_focus);
+ gtk_button_get_props (button, &default_border, &default_outside_border, NULL, NULL, &interior_focus);
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
GtkWidget *child;
GtkBorder default_border;
GtkBorder inner_border;
- GtkBorder *border;
+ GtkBorder padding;
gint focus_width;
gint focus_pad;
gint minimum, natural;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
- gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL);
+ gtk_button_get_props (button, &default_border, NULL, &inner_border, &padding, NULL);
gtk_style_context_get_style (context,
"focus-line-width", &focus_width,
"focus-padding", &focus_pad,
NULL);
- gtk_style_context_get (context, state,
- "border-width", &border,
- NULL);
-
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- minimum = (border->left + border->right +
- inner_border.left + inner_border.right);
+ minimum = inner_border.left + inner_border.right + padding.left + padding.right;
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
minimum += default_border.left + default_border.right;
}
else
{
- minimum = (border->top + border->bottom +
- inner_border.top + inner_border.bottom);
+ minimum = inner_border.top + inner_border.bottom + padding.top + padding.bottom;
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
minimum += default_border.top + default_border.bottom;
if (natural_size)
*natural_size = natural;
-
- gtk_border_free (border);
}
static void