diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 18:18:54 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 18:18:54 +0000 |
commit | 7ff431eff426668988f79fb2cb23b6ae3a0ef7d1 (patch) | |
tree | 905ace285a09e9f51a4182a37b56fdaa8a524ab6 /chrome/browser/gtk/gtk_theme_provider.cc | |
parent | e97831dd75f59483cca12b7cb397bdbc0e945cd4 (diff) | |
download | chromium_src-7ff431eff426668988f79fb2cb23b6ae3a0ef7d1.zip chromium_src-7ff431eff426668988f79fb2cb23b6ae3a0ef7d1.tar.gz chromium_src-7ff431eff426668988f79fb2cb23b6ae3a0ef7d1.tar.bz2 |
Only calculate the GTK scrollbar colors once and then update all RenderPreferences on theme change.
BUG=10949
TEST=none
Review URL: http://codereview.chromium.org/525016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/gtk_theme_provider.cc')
-rw-r--r-- | chrome/browser/gtk/gtk_theme_provider.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc index 971be0c..3c0efec 100644 --- a/chrome/browser/gtk/gtk_theme_provider.cc +++ b/chrome/browser/gtk/gtk_theme_provider.cc @@ -171,11 +171,13 @@ void GtkThemeProvider::InitThemesFor(NotificationObserver* observer) { void GtkThemeProvider::SetTheme(Extension* extension) { profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, false); + LoadDefaultValues(); BrowserThemeProvider::SetTheme(extension); } void GtkThemeProvider::UseDefaultTheme() { profile()->GetPrefs()->SetBoolean(prefs::kUsesSystemTheme, false); + LoadDefaultValues(); BrowserThemeProvider::UseDefaultTheme(); } @@ -238,26 +240,7 @@ GdkColor GtkThemeProvider::GetBorderColor() const { void GtkThemeProvider::GetScrollbarColors(GdkColor* thumb_active_color, GdkColor* thumb_inactive_color, - GdkColor* track_color, - bool use_gtk_theme) { - if (!use_gtk_theme) { - // If using the default non-GTK colors, pick some reasonable choices of - // different greys. - thumb_active_color->pixel = 0; - thumb_active_color->red = 64250; - thumb_active_color->green = 63736; - thumb_active_color->blue = 62965; - thumb_inactive_color->pixel = 0; - thumb_inactive_color->red = 61680; - thumb_inactive_color->green = 60395; - thumb_inactive_color->blue = 58853; - track_color->pixel = 0; - track_color->red = 58339; - track_color->green = 56797; - track_color->blue = 55512; - return; - } - + GdkColor* track_color) { // Create window containing scrollbar elements GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP); GtkWidget* fixed = gtk_fixed_new(); @@ -390,6 +373,7 @@ void GtkThemeProvider::LoadThemePrefs() { if (use_gtk_) { LoadGtkValues(); } else { + LoadDefaultValues(); BrowserThemeProvider::LoadThemePrefs(); } } @@ -556,6 +540,22 @@ void GtkThemeProvider::LoadGtkValues() { &inactive_frame_color); SetTintToExactColor(BrowserThemeProvider::TINT_FRAME_INCOGNITO_INACTIVE, &inactive_frame_color); + + focus_ring_color_ = GdkToSkColor(&button_color); + GdkColor thumb_active_color, thumb_inactive_color, track_color; + GtkThemeProvider::GetScrollbarColors(&thumb_active_color, + &thumb_inactive_color, + &track_color); + thumb_active_color_ = GdkToSkColor(&thumb_active_color); + thumb_inactive_color_ = GdkToSkColor(&thumb_inactive_color); + track_color_ = GdkToSkColor(&track_color); +} + +void GtkThemeProvider::LoadDefaultValues() { + focus_ring_color_ = SkColorSetARGB(255, 229, 151, 0); + thumb_active_color_ = SkColorSetRGB(250, 248, 245); + thumb_inactive_color_ = SkColorSetRGB(240, 235, 229); + track_color_ = SkColorSetRGB(227, 221, 216); } void GtkThemeProvider::SetThemeColorFromGtk(int id, GdkColor* color) { |