[gtk+] viewport: Set frame styleclass when getting border size during size allocation
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] viewport: Set frame styleclass when getting border size during size allocation
- Date: Thu, 9 Feb 2012 15:41:49 +0000 (UTC)
commit 6723feae8a314b806ff783507182208107e08007
Author: Alexander Larsson <alexl redhat com>
Date: Thu Feb 9 16:36:46 2012 +0100
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.
gtk/gtkviewport.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 048d0f6..73238ee 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -328,9 +328,14 @@ viewport_get_view_allocation (GtkViewport *viewport,
context = gtk_widget_get_style_context (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_border (context, state, &border);
+ gtk_style_context_restore (context);
+
if (priv->shadow_type != GTK_SHADOW_NONE)
{
view_allocation->x = border.left;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]