diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 18:12:56 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-11 18:12:56 +0000 |
commit | 11383e6f1d451d78b317c1b7260f6bc22cdbc7e3 (patch) | |
tree | 64593f4623bda716ab24f1d0567dfbba4d9eeeed | |
parent | efce17b6c7af96f3f2db55342b94ce44246cfb36 (diff) | |
download | chromium_src-11383e6f1d451d78b317c1b7260f6bc22cdbc7e3.zip chromium_src-11383e6f1d451d78b317c1b7260f6bc22cdbc7e3.tar.gz chromium_src-11383e6f1d451d78b317c1b7260f6bc22cdbc7e3.tar.bz2 |
Since themes are designed with the custom frame in mind, we need to offset
the background when the custom frame is off.
This is needed after http://codereview.chromium.org/193030 was checked in (which fixed a related bug on Windows).
We don't translate the x values because the tab renderer code
already takes the x offset into consideration.
TEST=Install the Color Chips theme from the theme gallery. The vertical white lines should line up on the inactive tabs.
Review URL: http://codereview.chromium.org/194080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25988 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 7fcb7e6..2a8d81e 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -118,6 +118,12 @@ const int kResizeAreaCornerSize = 16; // actually a couple pixels more that should overlap the toolbar and web // content area, but we don't use those pixels. const int kContentShadowThickness = 2; +// The offset to the background when the custom frame is off. We want the +// window background to line up with the tab background regardless of whether +// we're in custom frame mode or not. Since themes are designed with the +// custom frame in mind, we need to offset the background when the custom frame +// is off. +const int kCustomFrameBackgroundVerticalOffset = 15; base::LazyInstance<ActiveWindowWatcher> g_active_window_watcher(base::LINKER_INITIALIZED); @@ -630,7 +636,9 @@ gboolean BrowserWindowGtk::OnCustomFrameExpose(GtkWidget* widget, } CairoCachedSurface* surface = theme_provider->GetSurfaceNamed( image_name, widget); - surface->SetSource(cr, 0, 0); + surface->SetSource(cr, + 0, + window->UseCustomFrame() ? 0 : -kCustomFrameBackgroundVerticalOffset); cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, event->area.height); |