diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-08 19:22:13 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-08 19:22:13 +0000 |
commit | df7fba1ca4a21fbf8d5738d522b4b63abbf425fe (patch) | |
tree | 1e4ad8d09520adce8e83ad563445ec3799bc9ad5 /chrome/browser/gtk/bookmark_bar_gtk.cc | |
parent | fd2fa3fe2b81d0125c20a6d6f352386bac4a8e23 (diff) | |
download | chromium_src-df7fba1ca4a21fbf8d5738d522b4b63abbf425fe.zip chromium_src-df7fba1ca4a21fbf8d5738d522b4b63abbf425fe.tar.gz chromium_src-df7fba1ca4a21fbf8d5738d522b4b63abbf425fe.tar.bz2 |
GTK Theme: Don't render IDR_THEME_TOOLBAR on GtkWidgets.
IDR_THEME_TOOLBAR is a generated blank image of the bg[SELECTED] color,
which will be drawn by default on GtkWidgets. Uploading an image of
said color to the X server on each expose and then asking it to tile the
image across the widget is silly; stop doing it.
Also sets clip rectangles correctly in a few places where we were using GdkGC
instead of skia.
Review URL: http://codereview.chromium.org/196044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 45cd4e0..eb16e2e 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, |