summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 00:30:17 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 00:30:17 +0000
commit71fd4a1ba4fcf4ef9ae5d869837b1a681749227d (patch)
tree6c60cef227e7619b035dcb9b37b513d6dc9d9b88 /chrome/browser/gtk
parentf68ac2a0e072a212a46712531143eb33d48b2617 (diff)
downloadchromium_src-71fd4a1ba4fcf4ef9ae5d869837b1a681749227d.zip
chromium_src-71fd4a1ba4fcf4ef9ae5d869837b1a681749227d.tar.gz
chromium_src-71fd4a1ba4fcf4ef9ae5d869837b1a681749227d.tar.bz2
GTK: Update wrench menu icon on GTK theme change.
BUG=none TEST=switch GTK themes; wrench icon should change. Review URL: http://codereview.chromium.org/3468004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.cc13
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.h3
2 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc
index f802bc5d..4cff2f2 100644
--- a/chrome/browser/gtk/browser_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_toolbar_gtk.cc
@@ -204,11 +204,12 @@ void BrowserToolbarGtk::Init(Profile* profile,
FALSE, FALSE, 0);
}
+ wrench_menu_image_ = gtk_image_new_from_pixbuf(
+ theme_provider_->GetRTLEnabledPixbufNamed(IDR_TOOLS));
wrench_menu_button_.reset(new CustomDrawButton(
GtkThemeProvider::GetFrom(profile_),
IDR_TOOLS, IDR_TOOLS_P, IDR_TOOLS_H, 0,
- gtk_image_new_from_pixbuf(
- theme_provider_->GetRTLEnabledPixbufNamed(IDR_TOOLS))));
+ wrench_menu_image_));
GtkWidget* wrench_button = wrench_menu_button_->widget();
gtk_widget_set_tooltip_text(
@@ -387,6 +388,14 @@ void BrowserToolbarGtk::Observe(NotificationType type,
// themes, we want to let the background show through the toolbar.
gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box_), use_gtk);
+ if (use_gtk) {
+ // We need to manually update the icon if we are in GTK mode. (Note that
+ // we set the initial value in Init()).
+ gtk_image_set_from_pixbuf(
+ GTK_IMAGE(wrench_menu_image_),
+ theme_provider_->GetRTLEnabledPixbufNamed(IDR_TOOLS));
+ }
+
UpdateRoundedness();
} else if (type == NotificationType::UPGRADE_RECOMMENDED) {
MaybeShowUpgradeReminder();
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.h b/chrome/browser/gtk/browser_toolbar_gtk.h
index ec0c4c8..1eb16ef 100644
--- a/chrome/browser/gtk/browser_toolbar_gtk.h
+++ b/chrome/browser/gtk/browser_toolbar_gtk.h
@@ -203,6 +203,9 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver,
scoped_ptr<BrowserActionsToolbarGtk> actions_toolbar_;
scoped_ptr<CustomDrawButton> wrench_menu_button_;
+ // The image shown in GTK+ mode in the wrench button.
+ GtkWidget* wrench_menu_image_;
+
// The model that contains the security level, text, icon to display...
ToolbarModel* model_;