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

Unified Diff: chrome/browser/gtk/bookmark_bar_gtk.cc

Issue 196044: GTK Theme: Don't render IDR_THEME_TOOLBAR on GtkWidgets. (Closed)
Patch Set: Created 11 years, 3 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 | « no previous file | chrome/browser/gtk/browser_toolbar_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/bookmark_bar_gtk.cc
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index 45cd4e0e3b6be597853403c17a2659e6262dd79f..eb16e2eb3dfadc089a081bee228e55286d277435 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -176,7 +176,8 @@ void BookmarkBarGtk::Init(Profile* profile) {
g_signal_connect(instructions_, "drag-data-received",
G_CALLBACK(&OnDragReceived), this);
- gtk_widget_set_app_paintable(widget(), TRUE);
+ // Only paint in chrome theme mode.
+ gtk_widget_set_app_paintable(widget(), !theme_provider_->UseGtkTheme());
g_signal_connect(G_OBJECT(widget()), "expose-event",
G_CALLBACK(&OnEventBoxExpose), this);
@@ -489,6 +490,9 @@ void BookmarkBarGtk::Observe(NotificationType type,
<< "don't have a BookmarkModel. Taking no action.";
}
+ // When using the GTK+ theme, let GTK optimize the background drawing.
+ gtk_widget_set_app_paintable(widget(), !theme_provider_->UseGtkTheme());
+
// When using the GTK+ theme, we need to have the event box be visible so
// buttons don't get a halo color from the background. When using Chromium
// themes, we want to let the background show through the toolbar.
@@ -891,6 +895,10 @@ void BookmarkBarGtk::OnDragReceived(GtkWidget* widget,
gboolean BookmarkBarGtk::OnEventBoxExpose(GtkWidget* widget,
GdkEventExpose* event,
BookmarkBarGtk* bar) {
+ // We don't need to render the toolbar image in GTK mode.
+ if (bar->theme_provider_->UseGtkTheme())
+ return FALSE;
+
// Paint the background theme image.
cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
cairo_rectangle(cr, event->area.x, event->area.y,
« no previous file with comments | « no previous file | chrome/browser/gtk/browser_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698