diff options
author | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-19 05:16:19 +0000 |
---|---|---|
committer | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-19 05:18:05 +0000 |
commit | 341bea48664dea6b969966f8ca753fa8e4e5b8b1 (patch) | |
tree | 9ddd9cbafd89d78c4c81d7641bb3b2573d8721c0 | |
parent | e3f4075f213a0df59a0cb7e61ac7ef8016a2eebf (diff) | |
download | chromium_src-341bea48664dea6b969966f8ca753fa8e4e5b8b1.zip chromium_src-341bea48664dea6b969966f8ca753fa8e4e5b8b1.tar.gz chromium_src-341bea48664dea6b969966f8ca753fa8e4e5b8b1.tar.bz2 |
Don't draw the client edge in custom frames.
See bug for screenshots.
Currently, we draw this 1px edge between the content area and its
shadow. This looks weird and is not consistent with other frame types.
This should only affect Windows Classic.
BUG=348754
Review URL: https://codereview.chromium.org/478213002
Cr-Commit-Position: refs/heads/master@{#290496}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290496 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/views/color_constants.cc | 1 | ||||
-rw-r--r-- | ui/views/color_constants.h | 1 | ||||
-rw-r--r-- | ui/views/window/custom_frame_view.cc | 54 |
3 files changed, 25 insertions, 31 deletions
diff --git a/ui/views/color_constants.cc b/ui/views/color_constants.cc index 7e9aa58..a24bcc2 100644 --- a/ui/views/color_constants.cc +++ b/ui/views/color_constants.cc @@ -6,7 +6,6 @@ namespace views { -const SkColor kClientEdgeColor = SkColorSetRGB(210, 225, 246); const SkColor kWarningColor = SkColorSetRGB(0xde, 0x49, 0x32); } // namespace views diff --git a/ui/views/color_constants.h b/ui/views/color_constants.h index 8bd7c03..23c2420 100644 --- a/ui/views/color_constants.h +++ b/ui/views/color_constants.h @@ -10,7 +10,6 @@ namespace views { -VIEWS_EXPORT extern const SkColor kClientEdgeColor; VIEWS_EXPORT extern const SkColor kWarningColor; } // namespace views diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index 7dc62a3..4f9a529 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.cc @@ -401,7 +401,10 @@ void CustomFrameView::PaintTitleBar(gfx::Canvas* canvas) { void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { gfx::Rect client_area_bounds = frame_->client_view()->bounds(); - int client_area_top = client_area_bounds.y(); + // The shadows have a 1 pixel gap on the inside, so draw them 1 pixel inwards. + gfx::Rect shadowed_area_bounds = client_area_bounds; + shadowed_area_bounds.Inset(gfx::Insets(1, 1, 1, 1)); + int shadowed_area_top = shadowed_area_bounds.y(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); @@ -409,27 +412,27 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { const gfx::ImageSkia* top_left = rb.GetImageSkiaNamed(IDR_APP_TOP_LEFT); const gfx::ImageSkia* top_center = rb.GetImageSkiaNamed(IDR_APP_TOP_CENTER); const gfx::ImageSkia* top_right = rb.GetImageSkiaNamed(IDR_APP_TOP_RIGHT); - int top_edge_y = client_area_top - top_center->height(); + int top_edge_y = shadowed_area_top - top_center->height(); canvas->DrawImageInt(*top_left, - client_area_bounds.x() - top_left->width(), + shadowed_area_bounds.x() - top_left->width(), top_edge_y); canvas->TileImageInt(*top_center, - client_area_bounds.x(), + shadowed_area_bounds.x(), top_edge_y, - client_area_bounds.width(), + shadowed_area_bounds.width(), top_center->height()); - canvas->DrawImageInt(*top_right, client_area_bounds.right(), top_edge_y); + canvas->DrawImageInt(*top_right, shadowed_area_bounds.right(), top_edge_y); // Right side. const gfx::ImageSkia* right = rb.GetImageSkiaNamed(IDR_CONTENT_RIGHT_SIDE); - int client_area_bottom = - std::max(client_area_top, client_area_bounds.bottom()); - int client_area_height = client_area_bottom - client_area_top; + int shadowed_area_bottom = + std::max(shadowed_area_top, shadowed_area_bounds.bottom()); + int shadowed_area_height = shadowed_area_bottom - shadowed_area_top; canvas->TileImageInt(*right, - client_area_bounds.right(), - client_area_top, + shadowed_area_bounds.right(), + shadowed_area_top, right->width(), - client_area_height); + shadowed_area_height); // Bottom: left, center, right sides. const gfx::ImageSkia* bottom_left = @@ -440,32 +443,25 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { rb.GetImageSkiaNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER); canvas->DrawImageInt(*bottom_left, - client_area_bounds.x() - bottom_left->width(), - client_area_bottom); + shadowed_area_bounds.x() - bottom_left->width(), + shadowed_area_bottom); canvas->TileImageInt(*bottom_center, - client_area_bounds.x(), - client_area_bottom, - client_area_bounds.width(), + shadowed_area_bounds.x(), + shadowed_area_bottom, + shadowed_area_bounds.width(), bottom_right->height()); canvas->DrawImageInt(*bottom_right, - client_area_bounds.right(), - client_area_bottom); + shadowed_area_bounds.right(), + shadowed_area_bottom); // Left side. const gfx::ImageSkia* left = rb.GetImageSkiaNamed(IDR_CONTENT_LEFT_SIDE); canvas->TileImageInt(*left, - client_area_bounds.x() - left->width(), - client_area_top, + shadowed_area_bounds.x() - left->width(), + shadowed_area_top, left->width(), - client_area_height); - - // Draw the color to fill in the edges. - canvas->FillRect(gfx::Rect(client_area_bounds.x() - 1, - client_area_top - 1, - client_area_bounds.width() + 1, - client_area_bottom - client_area_top + 1), - kClientEdgeColor); + shadowed_area_height); } SkColor CustomFrameView::GetFrameColor() const { |