[PATCH] Fix for theming problem while renaming



Hi,

I have fixed the following accessibility bug and uploaded a patch.

http://bugzilla.gnome.org/show_bug.cgi?id=123207

The patch fixes theming problems while re-naming a folder/file in
nautilus icon view. 

Kindly review it.

Thanks,
Narayana
--- eel/ChangeLog	Thu Dec 11 11:13:30 2003
+++ eel-new/ChangeLog	Mon Dec 29 11:05:02 2003
@@ -1,3 +1,10 @@
+2003-12-29  Narayana Pattipati <narayana pattipati wipro com>
+
+	* eel/eel-editable-label.c (eel_editable_label_style_set), 
+	(eel_editable_label_expose): Change the background, foreground,
+	cursor and outer rectangle colors according to the theme
+	selected. Fixes bugzilla bug#123207
+
 2003-12-11  Alexander Larsson  <alexl redhat com>
 
 	* eel/eel-stock-dialogs.c (show_message_dialog):
--- eel/eel/eel-editable-label.c	Mon Dec 29 10:59:08 2003
+++ eel-new/eel/eel-editable-label.c	Mon Dec 29 10:58:58 2003
@@ -1219,6 +1219,7 @@ eel_editable_label_style_set (GtkWidget 
 			      GtkStyle  *previous_style)
 {
   EelEditableLabel *label;
+  static GdkColor gray = { 0, 0x8888, 0x8888, 0x8888 };
   
   g_return_if_fail (EEL_IS_EDITABLE_LABEL (widget));
   
@@ -1226,6 +1227,34 @@ eel_editable_label_style_set (GtkWidget 
 
   /* We have to clear the layout, fonts etc. may have changed */
   eel_editable_label_recompute (label);
+
+  /* Set the background, foreground and cursor colors based on 
+   * the new theme selected.
+   */
+  if (GTK_WIDGET_REALIZED (widget))
+    {
+	gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
+
+	if (label->primary_cursor_gc != NULL) 
+	  {
+		gtk_gc_release (label->primary_cursor_gc);
+		label->primary_cursor_gc = NULL;
+	  }
+
+	if (label->secondary_cursor_gc != NULL) 
+	  {
+		gtk_gc_release (label->secondary_cursor_gc);
+		label->secondary_cursor_gc = NULL;
+	  }
+
+	label->primary_cursor_gc = make_cursor_gc (widget,
+						   "cursor-color",
+						   &widget->style->black);
+
+	label->secondary_cursor_gc = make_cursor_gc (widget,
+						     "secondary-cursor-color",
+						     &gray);
+    }
 }
 
 static void 
@@ -1545,7 +1574,7 @@ eel_editable_label_expose (GtkWidget    
 
       if (label->draw_outline)
 	gdk_draw_rectangle (widget->window,
-			    widget->style->black_gc,
+			    widget->style->fg_gc [GTK_WIDGET_STATE (widget)],
 			    FALSE,
 			    0, 0,
 			    widget->allocation.width - 1,


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