[gtk+] treeview: use the CELL style class while doing cell size request



commit 2cbf3c66ef79f70007d8be17feec89ab86aa447a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun May 4 20:00:16 2014 +0200

    treeview: use the CELL style class while doing cell size request
    
    Since we use the same style class later when we draw them. Otherwise
    we'll get inconsistent results for CSS borders/paddings between the two
    cycles.

 gtk/gtktreeview.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 9a1cc90..73c37c1 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -6131,6 +6131,7 @@ validate_row (GtkTreeView *tree_view,
              GtkTreePath *path)
 {
   GtkTreeViewColumn *column;
+  GtkStyleContext *context;
   GList *list, *first_column, *last_column;
   gint height = 0;
   gint horizontal_separator;
@@ -6179,6 +6180,10 @@ validate_row (GtkTreeView *tree_view,
        first_column = first_column->next)
     ;
 
+  context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
+  gtk_style_context_save (context);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL);
+
   for (list = tree_view->priv->columns; list; list = list->next)
     {
       gint padding = 0;
@@ -6244,6 +6249,8 @@ validate_row (GtkTreeView *tree_view,
        retval = TRUE;
     }
 
+  gtk_style_context_restore (context);
+
   if (draw_hgrid_lines)
     height += grid_line_width;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]