diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 17:14:12 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 17:14:12 +0000 |
commit | 793b6b13899d674a47b86943ab4ba3b3ae82fe83 (patch) | |
tree | 06c5299431c692b1f26b1527e3686d08c6d7a545 /chrome | |
parent | 2e4633c5b2a040357659646b951b632bff3055f5 (diff) | |
download | chromium_src-793b6b13899d674a47b86943ab4ba3b3ae82fe83.zip chromium_src-793b6b13899d674a47b86943ab4ba3b3ae82fe83.tar.gz chromium_src-793b6b13899d674a47b86943ab4ba3b3ae82fe83.tar.bz2 |
Make the toolbar theme align with the left edge of the browser and the top edge of the tab strip.
BUG=none
TEST=install a theme with lines across the toolbar and frame, and verify that the lines line up across the frame,toolbar,bookmarks bar and find bar.
Review URL: http://codereview.chromium.org/155124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win.cc | 3 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_browser_frame_view.cc | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index a9ca39b..5cc5091 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -626,10 +626,10 @@ void BookmarkBarView::Paint(gfx::Canvas* canvas) { } else { gfx::Rect bounds = GetBounds(views::View::APPLY_MIRRORING_TRANSFORMATION); - // +1 is for toolbar outdent. canvas->TileImageInt(*GetThemeProvider()-> GetBitmapNamed(IDR_THEME_TOOLBAR), - bounds.x() + 1, bounds.y(), 0, 0, width(), height()); + GetParent()->GetBounds(views::View::APPLY_MIRRORING_TRANSFORMATION).x() + + bounds.x(), bounds.y(), 0, 0, width(), height()); canvas->FillRectInt(ResourceBundle::toolbar_separator_color, 0, height() - 1, width(), 1); } diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index 4272ef7..e70fefd 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -422,8 +422,9 @@ void FindBarWin::AnimationEnded(const Animation* animation) { void FindBarWin::GetThemePosition(gfx::Rect* bounds) { *bounds = GetDialogPosition(gfx::Rect()); + gfx::Rect toolbar_bounds = browser_view_->GetToolbarBounds(); gfx::Rect tab_strip_bounds = browser_view_->GetTabStripBounds(); - bounds->Offset(-tab_strip_bounds.x(), -tab_strip_bounds.y()); + bounds->Offset(-toolbar_bounds.x(), -tab_strip_bounds.y()); } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index dcde062..6f6391c 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1483,10 +1483,12 @@ void BrowserView::InitSystemMenu() { #endif int BrowserView::LayoutTabStrip() { - gfx::Rect tabstrip_bounds; - tabstrip_bounds = frame_->GetBoundsForTabStrip(tabstrip_); + gfx::Rect tabstrip_bounds = frame_->GetBoundsForTabStrip(tabstrip_); + gfx::Rect toolbar_bounds = GetToolbarBounds(); tabstrip_->SetBackgroundOffset( - gfx::Point(tabstrip_bounds.x(), tabstrip_bounds.y())); + gfx::Point(tabstrip_bounds.x() - toolbar_bounds.x(), + tabstrip_bounds.y())); + gfx::Point tabstrip_origin = tabstrip_bounds.origin(); ConvertPointToView(GetParent(), this, &tabstrip_origin); tabstrip_bounds.set_origin(tabstrip_origin); diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 56432b1..e652925 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -722,7 +722,7 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); canvas->TileImageInt(*theme_toolbar, - 0, strip_height - 1, // crop src + toolbar_bounds.x() - 1, strip_height - 1, // crop src toolbar_bounds.x() - 1, toolbar_bounds.y() + 2, toolbar_bounds.width() + 2, theme_toolbar->height()); |