OLD | NEW |
---|---|
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" |
(...skipping 13 matching lines...) Expand all Loading... | |
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 | 32 |
33 private: | 33 private: |
34 // views::View: | |
35 bool OnMousePressed(const ui::MouseEvent& event) override; | |
bruthig
2016/09/12 17:16:48
What about touch and keyboard interactions? I ass
yiyix
2016/09/20 20:25:46
Instead of override functions, I created a new fun
| |
36 void OnMouseReleased(const ui::MouseEvent& event) override; | |
37 | |
34 // Record whether the slider is in the active state or the disabled state. | 38 // Record whether the slider is in the active state or the disabled state. |
35 bool is_active_; | 39 bool is_active_; |
40 | |
41 // It is true if there is a press event or a touch event in this view | |
42 // currently; otherwise, it is false. | |
43 bool is_pressed_; | |
36 }; | 44 }; |
37 | 45 |
38 } // namespace views | 46 } // namespace views |
39 | 47 |
40 #endif // UI_VIEWS_CONTROLS_MD_SLIDER_H_ | 48 #endif // UI_VIEWS_CONTROLS_MD_SLIDER_H_ |
OLD | NEW |