summaryrefslogtreecommitdiffstats
path: root/editor/gui/editor_spin_slider.cpp
diff options
context:
space:
mode:
authorDavid Giardi <david.giardi.eng@gmail.com>2024-03-04 02:07:15 +0100
committerDavid Giardi <david.giardi.eng@gmail.com>2024-08-23 18:21:20 +0200
commite371587147868816e566b6b224da73ce7f2485c4 (patch)
tree01564446987b124c898ca8e717fc35bce040e25a /editor/gui/editor_spin_slider.cpp
parent739019e4e4a6e4763e37adfd9883a1c85d5f6249 (diff)
downloadredot-engine-e371587147868816e566b6b224da73ce7f2485c4.tar.gz
Improve SpinBox interaction, split arrows, add theme attributes
Diffstat (limited to 'editor/gui/editor_spin_slider.cpp')
-rw-r--r--editor/gui/editor_spin_slider.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/gui/editor_spin_slider.cpp b/editor/gui/editor_spin_slider.cpp
index 4e8d6d63bf..c05f47cb05 100644
--- a/editor/gui/editor_spin_slider.cpp
+++ b/editor/gui/editor_spin_slider.cpp
@@ -35,6 +35,7 @@
#include "core/os/keyboard.h"
#include "editor/editor_settings.h"
#include "editor/themes/editor_scale.h"
+#include "scene/theme/theme_db.h"
bool EditorSpinSlider::is_text_field() const {
return true;
@@ -383,7 +384,7 @@ void EditorSpinSlider::_draw_spin_slider() {
if (!hide_slider) {
if (get_step() == 1) {
- Ref<Texture2D> updown2 = get_theme_icon(is_read_only() ? SNAME("updown_disabled") : SNAME("updown"), SNAME("SpinBox"));
+ Ref<Texture2D> updown2 = is_read_only() ? theme_cache.updown_disabled_icon : theme_cache.updown_icon;
int updown_vofs = (size.height - updown2->get_height()) / 2;
if (rtl) {
updown_offset = sb->get_margin(SIDE_LEFT);
@@ -701,6 +702,9 @@ void EditorSpinSlider::_bind_methods() {
ADD_SIGNAL(MethodInfo("ungrabbed"));
ADD_SIGNAL(MethodInfo("value_focus_entered"));
ADD_SIGNAL(MethodInfo("value_focus_exited"));
+
+ BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, EditorSpinSlider, updown_icon, "updown");
+ BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_ICON, EditorSpinSlider, updown_disabled_icon, "updown_disabled");
}
void EditorSpinSlider::_ensure_input_popup() {