diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-02 03:04:51 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-02 03:04:51 +0000 |
commit | 8c579ee3804a4bc65ed9b8d2d3acda69923113dd (patch) | |
tree | ce88c116d5cc647a2bf75481f657d1587ecaae29 | |
parent | c26a25a9388017c4841fcc67faa68ab125a5dd15 (diff) | |
download | chromium_src-8c579ee3804a4bc65ed9b8d2d3acda69923113dd.zip chromium_src-8c579ee3804a4bc65ed9b8d2d3acda69923113dd.tar.gz chromium_src-8c579ee3804a4bc65ed9b8d2d3acda69923113dd.tar.bz2 |
Fix opaque app mode display.
Changed the app corner images to be the same size as the center image.
BUG=12541
TEST=In an opaque app-frame window, verify that the top edge doesn't have a frame-colored space between the drop shadow and the content area.
Review URL: http://codereview.chromium.org/118058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17378 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | app/resources/app_top_left.png | bin | 136 -> 132 bytes | |||
-rw-r--r-- | app/resources/app_top_right.png | bin | 136 -> 132 bytes | |||
-rw-r--r-- | chrome/browser/views/frame/opaque_browser_frame_view.cc | 18 |
3 files changed, 10 insertions, 8 deletions
diff --git a/app/resources/app_top_left.png b/app/resources/app_top_left.png Binary files differindex 78dc306f..797006f 100644 --- a/app/resources/app_top_left.png +++ b/app/resources/app_top_left.png diff --git a/app/resources/app_top_right.png b/app/resources/app_top_right.png Binary files differindex df3b9a3..25b59f2 100644 --- a/app/resources/app_top_right.png +++ b/app/resources/app_top_right.png diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 107875d..06777cb 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -758,6 +758,8 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { int client_area_top = frame_->GetWindow()->GetClientView()->y(); gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); + SkColor toolbar_color = tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR); + if (browser_view_->IsToolbarVisible()) { // The client edges start below the toolbar or its corner images, whichever // is shorter. @@ -768,18 +770,12 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { } else { // The toolbar isn't going to draw a client edge for us, so draw one // ourselves. - // This next calculation is necessary because the top center bitmap is - // shorter than the top left and right bitmaps. We need their top edges to - // line up, and we need the left and right edges to start below the corners' - // bottoms. SkBitmap* top_left = tp->GetBitmapNamed(IDR_APP_TOP_LEFT); SkBitmap* top_center = tp->GetBitmapNamed(IDR_APP_TOP_CENTER); SkBitmap* top_right = tp->GetBitmapNamed(IDR_APP_TOP_RIGHT); int top_edge_y = client_area_top - top_center->height(); - - client_area_top = std::min(top_edge_y + top_left->height(), - height() - NonClientBorderThickness()); int height = client_area_top - top_edge_y; + canvas->DrawBitmapInt(*top_left, 0, 0, top_left->width(), height, client_area_bounds.x() - top_left->width(), top_edge_y, top_left->width(), height, false); @@ -788,6 +784,13 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { canvas->DrawBitmapInt(*top_right, 0, 0, top_right->width(), height, client_area_bounds.right(), top_edge_y, top_right->width(), height, false); + + // Draw the toolbar color across the top edge. + canvas->DrawLineInt(toolbar_color, + client_area_bounds.x() - kClientEdgeThickness, + client_area_top - kClientEdgeThickness, + client_area_bounds.right() + kClientEdgeThickness, + client_area_top - kClientEdgeThickness); } int client_area_bottom = @@ -796,7 +799,6 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { // Draw the toolbar color so that the one pixel areas down the sides // show the right color even if not covered by the toolbar image. - SkColor toolbar_color = tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR); canvas->DrawLineInt(toolbar_color, client_area_bounds.x() - kClientEdgeThickness, client_area_top, |