summaryrefslogtreecommitdiff
path: root/scene/gui/spin_box.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/spin_box.h')
-rw-r--r--scene/gui/spin_box.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h
index 1b3dc9d79e..9ec3885f1f 100644
--- a/scene/gui/spin_box.h
+++ b/scene/gui/spin_box.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -39,12 +39,13 @@ class SpinBox : public Range {
GDCLASS(SpinBox, Range);
LineEdit *line_edit;
- int last_w;
+ int last_w = 0;
Timer *range_click_timer;
void _range_click_timeout();
+ void _release_mouse();
- void _text_entered(const String &p_string);
+ void _text_submitted(const String &p_string);
virtual void _value_changed(double) override;
String prefix;
String suffix;
@@ -52,11 +53,11 @@ class SpinBox : public Range {
void _line_edit_input(const Ref<InputEvent> &p_event);
struct Drag {
- float base_val;
- bool allowed;
- bool enabled;
+ float base_val = 0.0;
+ bool allowed = false;
+ bool enabled = false;
Vector2 capture_pos;
- float diff_y;
+ float diff_y = 0.0;
} drag;
void _line_edit_focus_exit();
@@ -64,7 +65,7 @@ class SpinBox : public Range {
inline void _adjust_width_for_icon(const Ref<Texture2D> &icon);
protected:
- void _gui_input(const Ref<InputEvent> &p_event);
+ virtual void gui_input(const Ref<InputEvent> &p_event) override;
void _notification(int p_what);