Expand timeline length spinner in AnimationTimelineEdit

This commit is contained in:
Silc Lizard (Tokage) Renew
2026-02-16 13:14:10 +09:00
parent ee713ccb7c
commit 60a44ecddd
+5 -2
View File
@@ -1461,6 +1461,7 @@ void AnimationTimelineEdit::_notification(int p_what) {
add_track->set_button_icon(get_editor_theme_icon(SNAME("Add")));
loop->set_button_icon(get_editor_theme_icon(SNAME("Loop")));
time_icon->set_texture(get_editor_theme_icon(SNAME("Time")));
time_icon->set_custom_minimum_size(Size2((get_editor_theme_icon(SNAME("Time"))->get_size().width + 16) * EDSCALE, 0));
filter_track->set_right_icon(get_editor_theme_icon(SNAME("Search")));
add_track->get_popup()->clear();
@@ -2081,13 +2082,14 @@ AnimationTimelineEdit::AnimationTimelineEdit() {
len_hb = memnew(HBoxContainer);
Control *expander = memnew(Control);
expander->set_h_size_flags(SIZE_EXPAND_FILL);
expander->set_custom_minimum_size(Vector2(2 * EDSCALE, 0));
expander->set_mouse_filter(MOUSE_FILTER_IGNORE);
len_hb->add_child(expander);
time_icon = memnew(TextureRect);
time_icon->set_v_size_flags(SIZE_SHRINK_CENTER);
time_icon->set_tooltip_text(TTRC("Animation length (seconds)"));
time_icon->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE);
time_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
len_hb->add_child(time_icon);
length = memnew(EditorSpinSlider);
@@ -2097,6 +2099,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() {
length->set_allow_greater(true);
length->set_custom_minimum_size(Vector2(70 * EDSCALE, 0));
length->set_control_state(EditorSpinSlider::CONTROL_STATE_HIDE);
length->set_h_size_flags(SIZE_EXPAND_FILL);
length->set_tooltip_text(TTRC("Animation length (seconds)"));
length->set_accessibility_name(TTRC("Animation length (seconds)"));
length->connect(SceneStringName(value_changed), callable_mp(this, &AnimationTimelineEdit::_anim_length_changed));