Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1636)

Unified Diff: chrome/browser/gtk/gtk_theme_provider.h

Issue 2864044: GTK: Fix highlight and image colors in the new wrench menu. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: estade comments Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/gtk_custom_menu_item.cc ('k') | chrome/browser/gtk/gtk_theme_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/gtk_theme_provider.h
diff --git a/chrome/browser/gtk/gtk_theme_provider.h b/chrome/browser/gtk/gtk_theme_provider.h
index e6321e965661379910385f02f34bed1682cd8daf..edc5ce7b42987c710c856bb2becfa5661c0a4be9 100644
--- a/chrome/browser/gtk/gtk_theme_provider.h
+++ b/chrome/browser/gtk/gtk_theme_provider.h
@@ -70,6 +70,10 @@ class GtkThemeProvider : public BrowserThemeProvider,
// label. Used for borders between GTK stuff and the webcontent.
GdkColor GetBorderColor() const;
+ // Returns a set of icons tinted for different GtkStateTypes based on the
+ // label colors for the IDR resource |id|.
+ GtkIconSet* GetIconSetForId(int id) const;
+
// This method returns averages of the thumb part and of the track colors.
// Used when rendering scrollbars.
static void GetScrollbarColors(GdkColor* thumb_active_color,
@@ -144,6 +148,18 @@ class GtkThemeProvider : public BrowserThemeProvider,
// Sets the values that we send to webkit to safe defaults.
void LoadDefaultValues();
+ // Builds all of the tinted menus images needed for custom buttons. This is
+ // always called on style-set even if we aren't using the gtk-theme because
+ // the menus are always rendered with gtk colors.
+ void RebuildMenuIconSets();
+
+ // Builds and tints the image with |id| to the GtkStateType |state| and
+ // places the result in |icon_set|.
+ void BuildIconFromIDRWithColor(int id,
+ GtkStyle* style,
+ GtkStateType state,
+ GtkIconSet* icon_set);
+
// Sets the underlying theme colors/tints from a GTK color.
void SetThemeColorFromGtk(int id, const GdkColor* color);
void SetThemeTintFromGtk(int id, const GdkColor* color);
@@ -156,6 +172,9 @@ class GtkThemeProvider : public BrowserThemeProvider,
// points to GtkThemeProvider's version.
void FreePerDisplaySurfaces(PerDisplaySurfaceMap* per_display_map);
+ // Frees all the created GtkIconSets we use for the chrome menu.
+ void FreeIconSets();
+
// Lazily generates each bitmap used in the gtk theme.
SkBitmap* GenerateGtkThemeBitmap(int id) const;
@@ -199,6 +218,7 @@ class GtkThemeProvider : public BrowserThemeProvider,
GtkWidget* fake_frame_;
OwnedWidgetGtk fake_label_;
OwnedWidgetGtk fake_entry_;
+ OwnedWidgetGtk fake_menu_item_;
// A list of all GtkChromeButton instances. We hold on to these to notify
// them of theme changes.
@@ -228,6 +248,11 @@ class GtkThemeProvider : public BrowserThemeProvider,
SkColor inactive_selection_bg_color_;
SkColor inactive_selection_fg_color_;
+ // A GtkIconSet that has the tinted icons for the NORMAL and PRELIGHT states
+ // of the IDR_FULLSCREEN_MENU_BUTTON tinted to the respective menu item label
+ // colors.
+ GtkIconSet* fullscreen_icon_set_;
+
// Image cache of lazily created images, created when requested by
// GetBitmapNamed().
mutable ImageCache gtk_images_;
« no previous file with comments | « chrome/browser/gtk/gtk_custom_menu_item.cc ('k') | chrome/browser/gtk/gtk_theme_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698