summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.cc7
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.h8
2 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc
index d65bd81..e3ce104 100644
--- a/chrome/browser/gtk/browser_toolbar_gtk.cc
+++ b/chrome/browser/gtk/browser_toolbar_gtk.cc
@@ -96,7 +96,10 @@ void BrowserToolbarGtk::Init(Profile* profile,
show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this);
+ event_box_ = gtk_event_box_new();
+
toolbar_ = gtk_hbox_new(FALSE, kToolbarWidgetSpacing);
+ gtk_container_add(GTK_CONTAINER(event_box_), toolbar_);
gtk_container_set_border_width(GTK_CONTAINER(toolbar_), 4);
// Demand we're always at least kToolbarHeight tall.
// -1 for width means "let GTK do its normal sizing".
@@ -176,7 +179,7 @@ void BrowserToolbarGtk::Init(Profile* profile,
// Force all the CustomDrawButtons to load the correct rendering style.
UserChangedTheme();
- gtk_widget_show_all(toolbar_);
+ gtk_widget_show_all(event_box_);
if (show_home_button_.GetValue()) {
gtk_widget_show(home_->widget());
@@ -186,7 +189,7 @@ void BrowserToolbarGtk::Init(Profile* profile,
}
void BrowserToolbarGtk::AddToolbarToBox(GtkWidget* box) {
- gtk_box_pack_start(GTK_BOX(box), toolbar_, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(box), event_box_, FALSE, FALSE, 0);
}
void BrowserToolbarGtk::Show() {
diff --git a/chrome/browser/gtk/browser_toolbar_gtk.h b/chrome/browser/gtk/browser_toolbar_gtk.h
index e6d76dc..fefb000 100644
--- a/chrome/browser/gtk/browser_toolbar_gtk.h
+++ b/chrome/browser/gtk/browser_toolbar_gtk.h
@@ -49,7 +49,7 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver,
// Getter for the containing widget.
GtkWidget* widget() {
- return toolbar_;
+ return event_box_;
}
virtual LocationBar* GetLocationBar() const;
@@ -152,6 +152,12 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver,
// Ninebox for the toolbar background
scoped_ptr<NineBox> background_ninebox_;
+ // An event box that holds |toolbar_|. We need the toolbar to have its own
+ // GdkWindow when we use the GTK drawing because otherwise the color from our
+ // parent GdkWindow will leak through with some theme engines (such as
+ // Clearlooks).
+ GtkWidget* event_box_;
+
// Gtk widgets. The toolbar is an hbox with each of the other pieces of the
// toolbar placed side by side.
GtkWidget* toolbar_;