[gnome-cyr] [PATCH] make gnumeric more gtk theme friendly (fwd)



 Hi, 

 Мне разрешили это закоммитить. Может кто закоммитить этот патч?

 Best regards,
  -Vlad

---------- Forwarded message ----------
Date: Sat, 3 Mar 2001 22:26:50 +0400 (SAMT)
From: Vlad Harchev <hvv hippo ru>
To: gnumeric-list gnome org
Subject: [PATCH] make gnumeric more gtk theme friendly

 Hi, 

 Here is a patch against gnumeric-0.58 that makes it more gtk theme friendly -
it will use gtk theme's text color instead of black for the following widgets:

* row and column bars (ItemBar's)
* SheetTabLabel (the name of the sheet on the notebook's tab)
* autoexpression label (the rightmost one in the status bar) - but it still
	uses "black" as text color for 1st window, in all subsequent windows
	it has proper color.

 It makes Gnumeric more usable if dark gtk theme is used (without this patch,
all texts in abovementioned widgets also will be black - i.e. totally
unreadable).

 Will it be commited?

 Best regards,
  -Vlad
diff -ru gnumeric-0.58~/src/item-bar.c gnumeric-0.58/src/item-bar.c
--- gnumeric-0.58~/src/item-bar.c	Thu Nov  9 06:42:36 2000
+++ gnumeric-0.58/src/item-bar.c	Sat Mar  3 22:03:36 2001
@@ -121,8 +121,12 @@
 
 	/* Configure our gc */
 	item_bar->gc = gc = gdk_gc_new (window);
-	gnome_canvas_get_color (item->canvas, "black", &c);
-	gdk_gc_set_foreground (item_bar->gc, &c);
+	{
+		GtkWidget* w = gtk_button_new();
+		gtk_widget_ensure_style(w);
+		gdk_gc_set_foreground (item_bar->gc, &w->style->text[GTK_STATE_NORMAL]);
+		gtk_widget_destroy(w);		
+	}
 
 	item_bar->normal_cursor = gdk_cursor_new (GDK_ARROW);
 	if (item_bar->orientation == GTK_ORIENTATION_VERTICAL)
diff -ru gnumeric-0.58~/src/widgets/widget-editable-label.c gnumeric-0.58/src/widgets/widget-editable-label.c
--- gnumeric-0.58~/src/widgets/widget-editable-label.c	Tue Sep 12 04:19:25 2000
+++ gnumeric-0.58/src/widgets/widget-editable-label.c	Sat Mar  3 21:12:00 2001
@@ -382,6 +382,10 @@
 
 	if (!el->text_item) {
 		GnomeCanvasGroup *root_group;
+		GtkWidget* text_color_widget;
+
+		text_color_widget = gtk_button_new();
+		gtk_widget_ensure_style(text_color_widget);
 
 		root_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (el)->root);
 
@@ -391,7 +395,10 @@
 			"text",     text,
 			"x",        (double) 1,
 			"y",        (double) 1,
+			"fill_color_gdk",	
+				&text_color_widget->style->text[GTK_STATE_NORMAL],
 			NULL);
+		gtk_widget_destroy(text_color_widget);
 	} else
 		el_change_text (el, text);
 }
diff -ru gnumeric-0.58~/src/workbook-control-gui.c gnumeric-0.58/src/workbook-control-gui.c
--- gnumeric-0.58~/src/workbook-control-gui.c	Mon Nov 13 00:53:05 2000
+++ gnumeric-0.58/src/workbook-control-gui.c	Sat Mar  3 21:47:33 2001
@@ -2844,7 +2844,7 @@
 
 	canvas = gnome_canvas_new ();
 
-	l = gtk_label_new ("Info");
+	l = gtk_button_new_with_label ("Info");
 	gtk_widget_ensure_style (l);
 
 	/* The canvas that displays text */
@@ -2856,7 +2856,7 @@
 		"y",        (double) 0,	/* FIXME :-) */
 		"font_gdk", l->style->font,
 		"anchor",   GTK_ANCHOR_NW,
-		"fill_color", "black",
+		"fill_color_gdk", &l->style->text[GTK_STATE_NORMAL],
 		NULL));
 	gtk_widget_set_usize (
 		GTK_WIDGET (canvas),


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