diff options
author | jonross <jonross@chromium.org> | 2014-11-24 06:50:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-24 14:50:45 +0000 |
commit | 88884629a2d16b3bada55d3a34d03772a1ff1ad5 (patch) | |
tree | feb83d0420b41598091ccdc4fd609bc18e20b129 | |
parent | fa0f1b8f5bc713bd262fa973ef4274da0169d922 (diff) | |
download | chromium_src-88884629a2d16b3bada55d3a34d03772a1ff1ad5.zip chromium_src-88884629a2d16b3bada55d3a34d03772a1ff1ad5.tar.gz chromium_src-88884629a2d16b3bada55d3a34d03772a1ff1ad5.tar.bz2 |
Make Separator respect Border Insets
Change the painting of a Separator from Paint to OnPaint. By switching to a canvas that uses the local bounds, the painting can check for the bounds of the content area to paint the line. This allows for the use of Borders to define insets for the view.
BUG=402515
TEST=Manual testing of Browser context menus, Session Crash Bubble.
Review URL: https://codereview.chromium.org/744323004
Cr-Commit-Position: refs/heads/master@{#305419}
-rw-r--r-- | ui/views/controls/separator.cc | 4 | ||||
-rw-r--r-- | ui/views/controls/separator.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ui/views/controls/separator.cc b/ui/views/controls/separator.cc index 4cca609..9a9bbbdc 100644 --- a/ui/views/controls/separator.cc +++ b/ui/views/controls/separator.cc @@ -53,8 +53,8 @@ void Separator::GetAccessibleState(ui::AXViewState* state) { state->role = ui::AX_ROLE_SPLITTER; } -void Separator::Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) { - canvas->FillRect(bounds(), color_); +void Separator::OnPaint(gfx::Canvas* canvas) { + canvas->FillRect(GetContentsBounds(), color_); } const char* Separator::GetClassName() const { diff --git a/ui/views/controls/separator.h b/ui/views/controls/separator.h index d30e01b..b0dfbce 100644 --- a/ui/views/controls/separator.h +++ b/ui/views/controls/separator.h @@ -38,7 +38,7 @@ class VIEWS_EXPORT Separator : public View { // Overridden from View: gfx::Size GetPreferredSize() const override; void GetAccessibleState(ui::AXViewState* state) override; - void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override; + void OnPaint(gfx::Canvas* canvas) override; const char* GetClassName() const override; private: |