From 5341a35f20dee167645b05d73fa3cfb23127d61f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 18 Dec 2009 13:47:02 +0100 Subject: Bug #604884 - Use proper colors in Search bar when is search activated --- shell/e-shell-content.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'shell/e-shell-content.c') diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index ddddcffd66..3ad3e8521a 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -124,15 +124,17 @@ shell_content_update_search_widgets (EShellContent *shell_content) if (sensitive) { GtkStyle *style; - const GdkColor *color; + const GdkColor *fg_color, *bg_color; style = gtk_widget_get_style (widget); - color = &style->light[GTK_STATE_SELECTED]; - gtk_widget_modify_base (widget, GTK_STATE_NORMAL, color); + fg_color = &style->text[(search_text != NULL && *search_text != '\0') ? GTK_STATE_SELECTED : GTK_STATE_INSENSITIVE]; + bg_color = &style->mid[GTK_STATE_SELECTED]; - style = gtk_widget_get_style (widget); - color = &style->text[(search_text != NULL && *search_text != '\0') ? GTK_STATE_SELECTED : GTK_STATE_INSENSITIVE]; - gtk_widget_modify_text (widget, GTK_STATE_NORMAL, color); + if (gdk_color_equal (fg_color, bg_color)) + bg_color = &style->base[GTK_STATE_SELECTED]; + + gtk_widget_modify_base (widget, GTK_STATE_NORMAL, bg_color); + gtk_widget_modify_text (widget, GTK_STATE_NORMAL, fg_color); } else { /* Text color will be updated when we move the focus. */ gtk_widget_modify_base (widget, GTK_STATE_NORMAL, NULL); -- cgit v1.2.3