summaryrefslogtreecommitdiffstats
path: root/ui/views/controls
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 03:22:35 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 03:22:35 +0000
commitb66771cf74ae096828c7ff680e821caf917fbe2c (patch)
tree3b8147f80b83125e70d40df53ea8c18bf90ca1df /ui/views/controls
parent6997ba2774a954634a491b0bae3944940d453fab (diff)
downloadchromium_src-b66771cf74ae096828c7ff680e821caf917fbe2c.zip
chromium_src-b66771cf74ae096828c7ff680e821caf917fbe2c.tar.gz
chromium_src-b66771cf74ae096828c7ff680e821caf917fbe2c.tar.bz2
[views] allot an extra pixel of space for the focus border on checkboxes
BUG=163105 Review URL: https://chromiumcodereview.appspot.com/11416354 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r--ui/views/controls/button/checkbox.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index d9ec541c..3241dca 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -15,6 +15,8 @@ namespace {
const int kCheckboxLabelSpacing = 4;
+const int kFocusBorderWidth = 1;
+
// A border with zero left inset.
class CheckboxNativeThemeBorder : public TextButtonNativeThemeBorder {
public:
@@ -63,7 +65,7 @@ gfx::Size Checkbox::GetPreferredSize() {
ui::NativeTheme::ExtraParams extra;
ui::NativeTheme::State state = GetThemeState(&extra);
gfx::Size size = GetNativeTheme()->GetPartSize(GetThemePart(), state, extra);
- prefsize.Enlarge(size.width() + kCheckboxLabelSpacing, 0);
+ prefsize.Enlarge(size.width() + kCheckboxLabelSpacing + kFocusBorderWidth, 0);
prefsize.set_height(std::max(prefsize.height(), size.height()));
if (max_width_ > 0)
@@ -87,7 +89,10 @@ void Checkbox::OnPaintFocusBorder(gfx::Canvas* canvas) {
gfx::Rect bounds(GetTextBounds());
// Increate the bounding box by one on each side so that that focus border
// does not draw on top of the letters.
- bounds.Inset(-1, -1, -1, -1);
+ bounds.Inset(-kFocusBorderWidth,
+ -kFocusBorderWidth,
+ -kFocusBorderWidth,
+ -kFocusBorderWidth);
canvas->DrawFocusRect(bounds);
}
}