viewport: Set frame styleclass when getting border size during size allocation

Without this you don't get the right border/padding for widget->window
and the border shows up under the scrolled contents.
This commit is contained in:
Alexander Larsson 2012-02-09 16:36:46 +01:00
parent c525fe27f3
commit 6723feae8a

View File

@ -328,9 +328,14 @@ viewport_get_view_allocation (GtkViewport *viewport,
context = gtk_widget_get_style_context (widget); context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget); state = gtk_widget_get_state_flags (widget);
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
gtk_style_context_get_padding (context, state, &padding); gtk_style_context_get_padding (context, state, &padding);
gtk_style_context_get_border (context, state, &border); gtk_style_context_get_border (context, state, &border);
gtk_style_context_restore (context);
if (priv->shadow_type != GTK_SHADOW_NONE) if (priv->shadow_type != GTK_SHADOW_NONE)
{ {
view_allocation->x = border.left; view_allocation->x = border.left;