summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-12 14:16:14 +0100
committerGitHub <noreply@github.com>2020-01-12 14:16:14 +0100
commit478ab8b45b51ccaafb9db0251ff760e7136e33f6 (patch)
tree03f6854895ba4bd4e79e5c883f2e4fb3a08de2f9 /scene/gui
parent26bb08f8b3b009f17645558309f4c5c02733e4c2 (diff)
parent083637a901569e872b3bcddc526818fd1e9ea3c4 (diff)
Merge pull request #34960 from johannesgunnar/spin_box-apply-method
Spinbox apply input method
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/spin_box.cpp5
-rw-r--r--scene/gui/spin_box.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index d5da35955c..92377949f8 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -259,6 +259,10 @@ bool SpinBox::is_editable() const {
return line_edit->is_editable();
}
+void SpinBox::apply() {
+ _text_entered(line_edit->get_text());
+}
+
void SpinBox::_bind_methods() {
//ClassDB::bind_method(D_METHOD("_value_changed"),&SpinBox::_value_changed);
@@ -272,6 +276,7 @@ void SpinBox::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_prefix"), &SpinBox::get_prefix);
ClassDB::bind_method(D_METHOD("set_editable", "editable"), &SpinBox::set_editable);
ClassDB::bind_method(D_METHOD("is_editable"), &SpinBox::is_editable);
+ ClassDB::bind_method(D_METHOD("apply"), &SpinBox::apply);
ClassDB::bind_method(D_METHOD("_line_edit_focus_exit"), &SpinBox::_line_edit_focus_exit);
ClassDB::bind_method(D_METHOD("get_line_edit"), &SpinBox::get_line_edit);
ClassDB::bind_method(D_METHOD("_line_edit_input"), &SpinBox::_line_edit_input);
diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h
index 13ba168ef3..04491c8477 100644
--- a/scene/gui/spin_box.h
+++ b/scene/gui/spin_box.h
@@ -88,6 +88,8 @@ public:
void set_prefix(const String &p_prefix);
String get_prefix() const;
+ void apply();
+
SpinBox();
};