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

Side by Side Diff: ui/views/controls/slider.cc

Issue 2714753002: Improve appearance of focus rings at fractional scales. (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/views/painter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/slider.h" 5 #include "ui/views/controls/slider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return; 191 return;
192 192
193 // TODO(estade): make this a glow effect instead: crbug.com/658783 193 // TODO(estade): make this a glow effect instead: crbug.com/658783
194 gfx::Rect focus_bounds = GetLocalBounds(); 194 gfx::Rect focus_bounds = GetLocalBounds();
195 focus_bounds.Inset(gfx::Insets(1)); 195 focus_bounds.Inset(gfx::Insets(1));
196 canvas->DrawSolidFocusRect( 196 canvas->DrawSolidFocusRect(
197 gfx::RectF(focus_bounds), 197 gfx::RectF(focus_bounds),
198 SkColorSetA(GetNativeTheme()->GetSystemColor( 198 SkColorSetA(GetNativeTheme()->GetSystemColor(
199 ui::NativeTheme::kColorId_FocusedBorderColor), 199 ui::NativeTheme::kColorId_FocusedBorderColor),
200 0x99), 200 0x99),
201 2.f); 201 2);
202 } 202 }
203 203
204 void Slider::OnSliderDragStarted() { 204 void Slider::OnSliderDragStarted() {
205 SetHighlighted(true); 205 SetHighlighted(true);
206 if (listener_) 206 if (listener_)
207 listener_->SliderDragStarted(this); 207 listener_->SliderDragStarted(this);
208 } 208 }
209 209
210 void Slider::OnSliderDragEnded() { 210 void Slider::OnSliderDragEnded() {
211 SetHighlighted(false); 211 SetHighlighted(false);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 event->SetHandled(); 343 event->SetHandled();
344 if (event->details().touch_points() <= 1) 344 if (event->details().touch_points() <= 1)
345 OnSliderDragEnded(); 345 OnSliderDragEnded();
346 break; 346 break;
347 default: 347 default:
348 break; 348 break;
349 } 349 }
350 } 350 }
351 351
352 } // namespace views 352 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/views/painter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698