Merge pull request #108929 from Giganzo/spin-slider-suffix

Add suffix to EditorSpinSlider tooltips
This commit is contained in:
Thaddeus Crews 2025-09-22 08:49:59 -05:00
commit 60c33a222c
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -40,9 +40,9 @@
String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const { String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const {
if (!read_only && grabber->is_visible()) { if (!read_only && grabber->is_visible()) {
Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL;
return TS->format_number(rtos(get_value())) + "\n\n" + vformat(TTR("Hold %s to round to integers.\nHold Shift for more precise changes."), find_keycode_name(key)); return TS->format_number(rtos(get_value())) + suffix + "\n\n" + vformat(TTR("Hold %s to round to integers.\nHold Shift for more precise changes."), find_keycode_name(key));
} }
return TS->format_number(rtos(get_value())); return TS->format_number(rtos(get_value())) + suffix;
} }
String EditorSpinSlider::get_text_value() const { String EditorSpinSlider::get_text_value() const {