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

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

Issue 2619953002: [ash-md] Updates slider control to show thumb highlight when focused (Closed)
Patch Set: Created 3 years, 11 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 | « ash/common/system/tray/tray_popup_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/md_slider.cc
diff --git a/ui/views/controls/md_slider.cc b/ui/views/controls/md_slider.cc
index 201450f62bb573a935faa4443fa9a45e4b838d44..acb97d75f6f645ae0431d0396a7b0be9079e8766 100644
--- a/ui/views/controls/md_slider.cc
+++ b/ui/views/controls/md_slider.cc
@@ -73,12 +73,14 @@ void MdSlider::OnPaint(gfx::Canvas* canvas) {
gfx::Point thumb_center(x, content.height() / 2);
// Paint the thumb highlight if it exists.
- if (is_active_ && thumb_highlight_radius_ > kThumbRadius) {
+ const int thumb_highlight_radius =
+ HasFocus() ? kThumbHighlightRadius : thumb_highlight_radius_;
+ if (is_active_ && thumb_highlight_radius > kThumbRadius) {
SkPaint highlight;
SkColor kHighlightColor = SkColorSetA(kActiveColor, kHighlightColorAlpha);
highlight.setColor(kHighlightColor);
highlight.setFlags(SkPaint::kAntiAlias_Flag);
- canvas->DrawCircle(thumb_center, thumb_highlight_radius_, highlight);
+ canvas->DrawCircle(thumb_center, thumb_highlight_radius, highlight);
}
// Paint the thumb of the slider.
« no previous file with comments | « ash/common/system/tray/tray_popup_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698