[gtk+/rendering-cleanup-next: 36/155] treeview: Draw empty tree view with Cairo



commit ace7056c2e9f32b77ccf4bfac63561bf18eec53b
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 6 12:19:58 2010 +0200

    treeview: Draw empty tree view with Cairo

 gtk/gtktreeview.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a712c54..cfa5dd0 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -4227,7 +4227,7 @@ invalidate_empty_focus (GtkTreeView *tree_view)
  * is empty.
  */
 static void
-draw_empty_focus (GtkTreeView *tree_view, GdkRectangle *clip_area)
+draw_empty_focus (GtkTreeView *tree_view, cairo_t *cr)
 {
   GtkWidget *widget = GTK_WIDGET (tree_view);
   gint w, h;
@@ -4241,10 +4241,9 @@ draw_empty_focus (GtkTreeView *tree_view, GdkRectangle *clip_area)
   h -= 2;
 
   if (w > 0 && h > 0)
-    gtk_paint_focus (gtk_widget_get_style (widget),
-		     tree_view->priv->bin_window,
+    gtk_cairo_paint_focus (gtk_widget_get_style (widget),
+                     cr,
 		     gtk_widget_get_state (widget),
-		     clip_area,
 		     widget,
 		     NULL,
 		     1, 1, w, h);
@@ -4395,20 +4394,17 @@ gtk_tree_view_bin_expose (GtkWidget      *widget,
 			"focus-line-width", &focus_line_width,
 			NULL);
 
+  cr = gdk_cairo_create (event->window);
+  gdk_cairo_region (cr, event->region);
+  cairo_clip (cr);
+
   if (tree_view->priv->tree == NULL)
     {
-      draw_empty_focus (tree_view, &event->area);
+      draw_empty_focus (tree_view, cr);
+      cairo_destroy (cr);
       return TRUE;
     }
 
-  /* clip event->area to the visible area */
-  if (event->area.height < 0)
-    return TRUE;
-
-  cr = gdk_cairo_create (event->window);
-  gdk_cairo_region (cr, event->region);
-  cairo_clip (cr);
-
   validate_visible_area (tree_view);
 
   style = gtk_widget_get_style (widget);



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