[PATCH] paint lines in GtkTree with gtktheme's text color rather than with hardcoded black



 Hi, 

 Here is a patch that will make lines in GtkTree painted with gtktheme's text
color rather than hardcoded black. 
 Please apply it - some apps still use GtkTree (e.g. testgtk, but not limited
to :), and without this patch GtkTrees look stupid.

 Please apply to both 1.2.x and 2.x

 Best regards,
  -Vlad

--- gtktreeitem.c-was	Thu Feb 15 21:41:08 2001
+++ gtktreeitem.c	Thu Feb 15 22:27:25 2001
@@ -580,6 +580,7 @@
   GtkTreeItem* item;
   GtkTree* tree;
   guint lx1, ly1, lx2, ly2;
+  GdkGC* gc;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_TREE_ITEM (widget));
@@ -587,6 +588,8 @@
   item = GTK_TREE_ITEM(widget);
   tree = GTK_TREE(widget->parent);
 
+  gc = widget->style->fg_gc[GTK_STATE_NORMAL];
+
   /* draw vertical line */
   lx1 = item->pixmaps_box->allocation.width;
   lx1 = lx2 = ((lx1 / 2) + (lx1 % 2) + 
@@ -598,7 +601,7 @@
     ly2 = (ly2 / 2) + (ly2 % 2);
 
   if (tree != tree->root_tree)
-    gdk_draw_line (widget->window, widget->style->black_gc, lx1, ly1, lx2, ly2);
+    gdk_draw_line (widget->window, gc, lx1, ly1, lx2, ly2);
 
   /* draw vertical line for subtree connecting */
   if(g_list_last(tree->children)->data != (gpointer)widget)
@@ -607,15 +610,14 @@
   lx2 += DEFAULT_DELTA;
 
   if (item->subtree && item->expanded)
-    gdk_draw_line (widget->window, widget->style->black_gc,
+    gdk_draw_line (widget->window, gc,
 		   lx2, ly2, lx2, widget->allocation.height);
 
   /* draw horizontal line */
   ly1 = ly2;
   lx2 += 2;
 
-  gdk_draw_line (widget->window, widget->style->black_gc,
-		 lx1, ly1, lx2, ly2);
+  gdk_draw_line (widget->window, gc, lx1, ly1, lx2, ly2);
 
   lx2 -= DEFAULT_DELTA+2;
   ly1 = 0;
@@ -630,7 +632,7 @@
 	  lx1 = lx2 -= tree->indent_value;
 	  
 	  if (g_list_last (tree->children)->data != item)
-	    gdk_draw_line (widget->window, widget->style->black_gc, lx1, ly1, lx2, ly2);
+	    gdk_draw_line (widget->window, gc, lx1, ly1, lx2, ly2);
 	  item = GTK_TREE_ITEM (tree->tree_owner);
 	  tree = GTK_TREE (GTK_WIDGET (tree)->parent);
 	} 





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