diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index b74ec0a..e193736 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -27,6 +27,7 @@ #include "chrome/common/notification_service.h" #include "gfx/font.h" #include "gfx/gtk_util.h" +#include "gfx/skia_utils_gtk.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "net/base/escape.h" @@ -41,6 +42,8 @@ #include "chrome/browser/gtk/location_bar_view_gtk.h" #endif +using gfx::SkColorToGdkColor; + namespace { const char kTextBaseColor[] = "#808080"; @@ -597,6 +600,10 @@ void AutocompleteEditViewGtk::SetBaseColor() { if (use_gtk) { gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, NULL); + gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, NULL); + gtk_widget_modify_text(text_view_, GTK_STATE_SELECTED, NULL); + gtk_widget_modify_base(text_view_, GTK_STATE_ACTIVE, NULL); + gtk_widget_modify_text(text_view_, GTK_STATE_ACTIVE, NULL); // Grab the text colors out of the style and set our tags to use them. GtkStyle* style = gtk_rc_get_style(text_view_); @@ -621,6 +628,23 @@ void AutocompleteEditViewGtk::SetBaseColor() { #endif gtk_widget_modify_base(text_view_, GTK_STATE_NORMAL, background_color_ptr); +#if !defined(TOOLKIT_VIEWS) + // Override the selected colors so we don't leak colors from the current + // gtk theme into the chrome-theme. + GdkColor c; + c = SkColorToGdkColor(theme_provider_->get_active_selection_bg_color()); + gtk_widget_modify_base(text_view_, GTK_STATE_SELECTED, &c); + + c = SkColorToGdkColor(theme_provider_->get_active_selection_fg_color()); + gtk_widget_modify_text(text_view_, GTK_STATE_SELECTED, &c); + + c = SkColorToGdkColor(theme_provider_->get_inactive_selection_bg_color()); + gtk_widget_modify_base(text_view_, GTK_STATE_ACTIVE, &c); + + c = SkColorToGdkColor(theme_provider_->get_inactive_selection_fg_color()); + gtk_widget_modify_text(text_view_, GTK_STATE_ACTIVE, &c); +#endif + g_object_set(faded_text_tag_, "foreground", kTextBaseColor, NULL); g_object_set(normal_text_tag_, "foreground", "#000000", NULL); } |