Make EditorSpinSlider display a slider for floats with a step of 1.0

Integers still don't display a slider (and use up/down arrows instead),
so that they can be quickly distinguished from floats in the inspector.

However, this now makes floats with a step of 1.0 look different
from integers in the inspector.
This commit is contained in:
Hugo Locurcio
2024-08-05 19:20:14 +02:00
parent f1c0b5b854
commit 57700b0563
4 changed files with 26 additions and 1 deletions

View File

@@ -1343,6 +1343,7 @@ void EditorPropertyInteger::setup(int64_t p_min, int64_t p_max, int64_t p_step,
EditorPropertyInteger::EditorPropertyInteger() {
spin = memnew(EditorSpinSlider);
spin->set_flat(true);
spin->set_editing_integer(true);
add_child(spin);
add_focusable(spin);
spin->connect(SceneStringName(value_changed), callable_mp(this, &EditorPropertyInteger::_value_changed));