summaryrefslogtreecommitdiffstats
path: root/scene/gui/spin_box.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-09-08 21:00:10 +0200
committerYuri Sizov <yuris@humnom.net>2023-09-11 13:45:23 +0200
commit2924bfd4d3c6dbdf01df3263000070634826f0a9 (patch)
tree779d2aa57557af3c2fe2828e6a3a570a32e7a61b /scene/gui/spin_box.cpp
parent8c1817f755b63a69378774d8d0f74499f663afe2 (diff)
downloadredot-engine-2924bfd4d3c6dbdf01df3263000070634826f0a9.tar.gz
Register theme properties with ThemeDB
Diffstat (limited to 'scene/gui/spin_box.cpp')
-rw-r--r--scene/gui/spin_box.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index 4af694ae3d..5b2ca9d53b 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -32,6 +32,7 @@
#include "core/input/input.h"
#include "core/math/expression.h"
+#include "scene/theme/theme_db.h"
Size2 SpinBox::get_minimum_size() const {
Size2 ms = line_edit->get_combined_minimum_size();
@@ -228,12 +229,6 @@ inline void SpinBox::_adjust_width_for_icon(const Ref<Texture2D> &icon) {
}
}
-void SpinBox::_update_theme_item_cache() {
- Range::_update_theme_item_cache();
-
- theme_cache.updown_icon = get_theme_icon(SNAME("updown"));
-}
-
void SpinBox::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
@@ -379,6 +374,8 @@ void SpinBox::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "suffix"), "set_suffix", "get_suffix");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "custom_arrow_step", PROPERTY_HINT_RANGE, "0,10000,0.0001,or_greater"), "set_custom_arrow_step", "get_custom_arrow_step");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "select_all_on_focus"), "set_select_all_on_focus", "is_select_all_on_focus");
+
+ BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, SpinBox, updown_icon, "updown");
}
SpinBox::SpinBox() {