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

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

Issue 10086005: ash: Show better focus rects for the tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
« ui/views/controls/slider.h ('K') | « ui/views/controls/slider.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/slider.cc
diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc
index 1f396c349120bf1e88363de7377221b90c014fec..074779320acf8c0ae3e450473577f8d28877318d 100644
--- a/ui/views/controls/slider.cc
+++ b/ui/views/controls/slider.cc
@@ -30,7 +30,8 @@ Slider::Slider(SliderListener* listener, Orientation orientation)
value_(0.f),
keyboard_increment_(0.1f),
animating_value_(0.f),
- value_is_valid_(false) {
+ value_is_valid_(false),
+ focus_color_(0) {
EnableCanvasFlippingForRTLUI(true);
set_focusable(true);
}
@@ -200,4 +201,13 @@ void Slider::GetAccessibleState(ui::AccessibleViewState* state) {
base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5)));
}
+void Slider::OnPaintFocusBorder(gfx::Canvas* canvas) {
+ if (!focus_color_) {
+ View::OnPaintFocusBorder(canvas);
+ } else if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
+ canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
+ focus_color_);
+ }
+}
+
} // namespace views
« ui/views/controls/slider.h ('K') | « ui/views/controls/slider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698