summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 17:47:14 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-22 17:47:14 +0000
commit8f95537072b2da7c797b157c5e77c6b7c95b886c (patch)
tree9626c8783e1c6c975dac65e8135fbac9ffa28579 /chrome
parent0ac8368b361a5edbcfe4b985131a8eec13304f49 (diff)
downloadchromium_src-8f95537072b2da7c797b157c5e77c6b7c95b886c.zip
chromium_src-8f95537072b2da7c797b157c5e77c6b7c95b886c.tar.gz
chromium_src-8f95537072b2da7c797b157c5e77c6b7c95b886c.tar.bz2
GTK: Use color data from the MetaFrames class in gtk+ theme mode.
Most themes have specific data for a "MetaFrames" class that we weren't using. This fixes the titlebar color for the xfce themes. I suspect that this also fixes 32173, but I don't have a Karmic machine yet so I can't test. BUG=32173 TEST=Themes with different titlebar and selection colors (Xfce-b5 was what I tested with) shouldn't use the selection color for the titlebar. Review URL: http://codereview.chromium.org/552092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.cc16
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.h5
2 files changed, 20 insertions, 1 deletions
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index 239308e..c6cf09d 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -439,7 +439,7 @@ void GtkThemeProvider::LoadGtkValues() {
profile()->GetPrefs()->GetMutableDictionary(prefs::kCurrentThemeImages);
pref_images->Clear();
- GtkStyle* window_style = gtk_rc_get_style(fake_window_);
+ GtkStyle* window_style = GetFrameStyle();
GtkStyle* label_style = gtk_rc_get_style(fake_label_.get());
GdkColor frame_color = window_style->bg[GTK_STATE_SELECTED];
@@ -603,6 +603,20 @@ void GtkThemeProvider::LoadGtkValues() {
link_color);
}
+GtkStyle* GtkThemeProvider::GetFrameStyle() {
+ GtkStyle* window_style =
+ gtk_rc_get_style_by_paths(gtk_widget_get_settings(fake_window_),
+ NULL, "MetaFrames",
+ G_TYPE_NONE);
+ if (!window_style) {
+ // Some themes don't specify the MetaFrames class, so do a normal lookup on
+ // our main window.
+ window_style = gtk_rc_get_style(fake_window_);
+ }
+
+ return window_style;
+}
+
void GtkThemeProvider::LoadDefaultValues() {
focus_ring_color_ = SkColorSetARGB(255, 229, 151, 0);
thumb_active_color_ = SkColorSetRGB(250, 248, 245);
diff --git a/chrome/browser/gtk/gtk_theme_provider.h b/chrome/browser/gtk/gtk_theme_provider.h
index b8a2379..db396ab 100644
--- a/chrome/browser/gtk/gtk_theme_provider.h
+++ b/chrome/browser/gtk/gtk_theme_provider.h
@@ -121,6 +121,11 @@ class GtkThemeProvider : public BrowserThemeProvider,
// BrowserThemeProvider interface and the colors we send to webkit.
void LoadGtkValues();
+ // Returns a GtkStyle* from which we get the colors for our frame. Checks for
+ // the optional "MetaFrames" widget class before returning the default
+ // GtkWindow one.
+ GtkStyle* GetFrameStyle();
+
// Sets the values that we send to webkit to safe defaults.
void LoadDefaultValues();