From 0ceb992ffaf2f66e62f34bd35ac35b6d436a9b76 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Sun, 19 Jan 2025 15:52:42 +0300 Subject: [PATCH] Fix incomplete FPS spinbox display in sprite frames editor --- editor/plugins/sprite_frames_editor_plugin.cpp | 6 ++++++ editor/plugins/sprite_frames_editor_plugin.h | 1 + 2 files changed, 7 insertions(+) diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 5cea634e6df..2f45e3fedec 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -1284,6 +1284,10 @@ void SpriteFramesEditor::_animation_loop_changed() { undo_redo->commit_action(); } +void SpriteFramesEditor::_animation_speed_resized() { + anim_speed->update_minimum_size(); +} + void SpriteFramesEditor::_animation_speed_changed(double p_value) { if (updating) { return; @@ -1970,6 +1974,8 @@ SpriteFramesEditor::SpriteFramesEditor() { anim_speed->set_step(0.01); anim_speed->set_custom_arrow_step(1); anim_speed->set_tooltip_text(TTR("Animation Speed")); + anim_speed->get_line_edit()->set_expand_to_text_length_enabled(true); + anim_speed->get_line_edit()->connect(SceneStringName(resized), callable_mp(this, &SpriteFramesEditor::_animation_speed_resized)); anim_speed->connect(SceneStringName(value_changed), callable_mp(this, &SpriteFramesEditor::_animation_speed_changed)); hbc_animlist->add_child(anim_speed); diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h index 896294482c1..6e58a355a0a 100644 --- a/editor/plugins/sprite_frames_editor_plugin.h +++ b/editor/plugins/sprite_frames_editor_plugin.h @@ -222,6 +222,7 @@ class SpriteFramesEditor : public HSplitContainer { void _animation_remove_confirmed(); void _animation_search_text_changed(const String &p_text); void _animation_loop_changed(); + void _animation_speed_resized(); void _animation_speed_changed(double p_value); void _frame_list_gui_input(const Ref &p_event);