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

Side by Side Diff: ui/views/controls/md_slider.h

Issue 2335513002: Adding ripple effect for clicks on MD slider (Closed)
Patch Set: improve animation in slider and address comments Created 4 years, 2 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 | « no previous file | ui/views/controls/md_slider.cc » ('j') | ui/views/controls/md_slider.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef UI_VIEWS_CONTROLS_MD_SLIDER_H_ 5 #ifndef UI_VIEWS_CONTROLS_MD_SLIDER_H_
6 #define UI_VIEWS_CONTROLS_MD_SLIDER_H_ 6 #define UI_VIEWS_CONTROLS_MD_SLIDER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/views/controls/slider.h" 9 #include "ui/views/controls/slider.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
11 #include "ui/views/views_export.h" 11 #include "ui/views/views_export.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 // TODO(yiyix): When material design is enabled by default, use 15 // TODO(yiyix): When material design is enabled by default, use
16 // MaterialDesignSlider as the default slider implementation. (crbug.com/614453) 16 // MaterialDesignSlider as the default slider implementation. (crbug.com/614453)
varkha 2016/09/23 22:30:25 nit: MdSlider to match the class name.
yiyix 2016/09/24 06:24:36 Done.
17 class VIEWS_EXPORT MdSlider : public Slider { 17 class VIEWS_EXPORT MdSlider : public Slider {
18 public: 18 public:
19 explicit MdSlider(SliderListener* listener); 19 explicit MdSlider(SliderListener* listener);
20 ~MdSlider() override; 20 ~MdSlider() override;
21 21
22 // ui::Slider: 22 // ui::Slider:
23 void UpdateState(bool control_on) override; 23 void UpdateState(bool control_on) override;
24 24
25 // views::View: 25 // views::View:
26 void OnPaint(gfx::Canvas* canvas) override; 26 void OnPaint(gfx::Canvas* canvas) override;
27 const char* GetClassName() const override; 27 const char* GetClassName() const override;
28 28
29 protected: 29 protected:
30 // ui::Slider: 30 // ui::Slider:
31 int GetThumbWidth() override; 31 int GetThumbWidth() override;
32 void SetHighlighted(bool is_highlighted) override;
32 33
33 private: 34 private:
35 // gfx::AnimationDelegate:
36 void AnimationProgressed(const gfx::Animation* animation) override;
37 void AnimationEnded(const gfx::Animation* animation) override;
38
34 // Record whether the slider is in the active state or the disabled state. 39 // Record whether the slider is in the active state or the disabled state.
35 bool is_active_; 40 bool is_active_;
41
42 // Animating value of the current radius size of the thumb's highlight.
43 float thumb_highlight_radius_;
44
45 std::unique_ptr<gfx::SlideAnimation> highlight_animation_;
36 }; 46 };
37 47
38 } // namespace views 48 } // namespace views
39 49
40 #endif // UI_VIEWS_CONTROLS_MD_SLIDER_H_ 50 #endif // UI_VIEWS_CONTROLS_MD_SLIDER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/md_slider.cc » ('j') | ui/views/controls/md_slider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698