Skip to content

Commit 757bba1

Browse files
committed
Merge pull request godotengine#113649 from YeldhamDev/editor_spin_min_fix
Fix `EditorSpinSlider` overriding the custom minimum size
2 parents 026f04e + 051f7c2 commit 757bba1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

editor/gui/editor_spin_slider.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const {
5252
return value;
5353
}
5454

55+
Size2 EditorSpinSlider::get_minimum_size() const {
56+
return Size2(0, get_theme_constant(SNAME("inspector_property_height"), EditorStringName(Editor)));
57+
}
58+
5559
String EditorSpinSlider::get_text_value() const {
5660
return TranslationServer::get_singleton()->format_number(editing_integer ? itos(get_value()) : String::num(get_value(), Math::range_step_decimals(get_step())), _get_locale());
5761
}
@@ -465,7 +469,6 @@ void EditorSpinSlider::_notification(int p_what) {
465469
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
466470
case NOTIFICATION_TRANSLATION_CHANGED:
467471
case NOTIFICATION_THEME_CHANGED: {
468-
set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("inspector_property_height"), EditorStringName(Editor))));
469472
_update_value_input_stylebox();
470473
} break;
471474

editor/gui/editor_spin_slider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class EditorSpinSlider : public Range {
112112
public:
113113
String get_tooltip(const Point2 &p_pos) const override;
114114

115+
virtual Size2 get_minimum_size() const override;
116+
115117
String get_text_value() const;
116118
void set_label(const String &p_label);
117119
String get_label() const;

0 commit comments

Comments
 (0)