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

Unified Diff: ui/views/controls/button/checkbox.cc

Issue 2734273002: Remove dashed focus rect from Views checkboxes. (Closed)
Patch Set: review Created 3 years, 9 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 | « ui/views/controls/button/checkbox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/checkbox.cc
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index 91d3a23f875ce24a3a4a82e3d76ade8634a2351a..7d933e14ad9aa34a57125ed2a31c79a48e7fc50f 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -33,13 +33,13 @@ Checkbox::Checkbox(const base::string16& label)
checked_(false) {
SetHorizontalAlignment(gfx::ALIGN_LEFT);
SetFocusForPlatform();
+ SetFocusPainter(nullptr);
if (UseMd()) {
set_request_focus_on_press(false);
SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON
: InkDropMode::OFF);
set_has_ink_drop_action_on_click(true);
- SetFocusPainter(nullptr);
} else {
std::unique_ptr<LabelButtonBorder> button_border(new LabelButtonBorder());
// Inset the trailing side by a couple pixels for the focus border.
@@ -104,18 +104,6 @@ bool Checkbox::UseMd() {
return ui::MaterialDesignController::IsSecondaryUiMaterial();
}
-void Checkbox::Layout() {
- LabelButton::Layout();
-
- if (!UseMd()) {
- // Construct a focus painter that only surrounds the label area.
- gfx::Rect rect = label()->GetMirroredBounds();
- rect.Inset(-2, 3);
- SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets(gfx::Insets(
- rect.y(), rect.x(), height() - rect.bottom(), width() - rect.right())));
- }
-}
-
const char* Checkbox::GetClassName() const {
return kViewClassName;
}
« no previous file with comments | « ui/views/controls/button/checkbox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698