Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: ui/views/controls/separator.cc

Issue 1276613002: Change sizing of views::Separator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/separator.cc
diff --git a/ui/views/controls/separator.cc b/ui/views/controls/separator.cc
index 9a9bbbdc881c4892648a69d5c28b29e349a2b153..e16346127ba4010be0e23670e856280dff926eda 100644
--- a/ui/views/controls/separator.cc
+++ b/ui/views/controls/separator.cc
@@ -44,9 +44,11 @@ void Separator::SetPreferredSize(int size) {
// Separator, View overrides:
gfx::Size Separator::GetPreferredSize() const {
- if (orientation_ == HORIZONTAL)
- return gfx::Size(width(), size_);
- return gfx::Size(size_, height());
+ gfx::Size size =
+ orientation_ == HORIZONTAL ? gfx::Size(1, size_) : gfx::Size(size_, 1);
+ gfx::Insets insets = GetInsets();
+ size.Enlarge(insets.width(), insets.height());
+ return size;
}
void Separator::GetAccessibleState(ui::AXViewState* state) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698