diff options
author | Milan Crha <mcrha@redhat.com> | 2009-12-18 20:47:02 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-12-18 20:47:02 +0800 |
commit | 5341a35f20dee167645b05d73fa3cfb23127d61f (patch) | |
tree | 5e6f37be94ad2a9132d6a5944a1fdd7ff2e50deb /shell | |
parent | fb84cc9a9a3ad37087aa63e59e5558affa3414d8 (diff) | |
download | gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.tar gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.tar.gz gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.tar.bz2 gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.tar.lz gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.tar.xz gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.tar.zst gsoc2013-evolution-5341a35f20dee167645b05d73fa3cfb23127d61f.zip |
Bug #604884 - Use proper colors in Search bar when is search activated
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-content.c | 14 |
1 files changed, 8 insertions, 6 deletions
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); |