[evolution] Bug #604884 - Use proper colors in Search bar when is search activated
- From: Milan Crha <mcrha src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution] Bug #604884 - Use proper colors in Search bar when is search activated
- Date: Fri, 18 Dec 2009 12:50:45 +0000 (UTC)
commit 5341a35f20dee167645b05d73fa3cfb23127d61f
Author: Milan Crha <mcrha redhat com>
Date: Fri Dec 18 13:47:02 2009 +0100
Bug #604884 - Use proper colors in Search bar when is search activated
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 ddddcff..3ad3e85 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]