diff options
Diffstat (limited to 'scene/gui/scroll_bar.h')
-rw-r--r-- | scene/gui/scroll_bar.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index ee5e7140cf..6ae76e453a 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -34,7 +34,6 @@ #include "scene/gui/range.h" class ScrollBar : public Range { - GDCLASS(ScrollBar, Range); enum HighlightStatus { @@ -48,13 +47,12 @@ class ScrollBar : public Range { Orientation orientation; Size2 size; - float custom_step; + float custom_step = -1; - HighlightStatus highlight; + HighlightStatus highlight = HIGHLIGHT_NONE; struct Drag { - - bool active; + bool active = false; float pos_at_click; float value_at_click; } drag; @@ -68,22 +66,23 @@ class ScrollBar : public Range { static void set_can_focus_by_default(bool p_can_focus); - Node *drag_node; + Node *drag_node = nullptr; NodePath drag_node_path; + bool drag_node_enabled = true; - Vector2 drag_node_speed; + Vector2 drag_node_speed = Vector2(); Vector2 drag_node_accum; Vector2 drag_node_from; Vector2 last_drag_node_accum; float last_drag_node_time; float time_since_motion; - bool drag_node_touching; - bool drag_node_touching_deaccel; + bool drag_node_touching = false; + bool drag_node_touching_deaccel = false; bool click_handled; - bool scrolling; - double target_scroll; - bool smooth_scroll_enabled; + bool scrolling = false; + double target_scroll = 0; + bool smooth_scroll_enabled = false; void _drag_node_exit(); void _drag_node_input(const Ref<InputEvent> &p_input); @@ -101,17 +100,17 @@ public: void set_drag_node(const NodePath &p_path); NodePath get_drag_node() const; + void set_drag_node_enabled(bool p_enable); void set_smooth_scroll_enabled(bool p_enable); bool is_smooth_scroll_enabled() const; - virtual Size2 get_minimum_size() const; + virtual Size2 get_minimum_size() const override; ScrollBar(Orientation p_orientation = VERTICAL); ~ScrollBar(); }; class HScrollBar : public ScrollBar { - GDCLASS(HScrollBar, ScrollBar); public: @@ -120,7 +119,6 @@ public: }; class VScrollBar : public ScrollBar { - GDCLASS(VScrollBar, ScrollBar); public: |