浏览代码

Make the SpriteFrames animation speed SpinBox take less vertical space

This makes it possible to display one more animation with the same
vertical space.

(cherry picked from commit 2427a9cafcfba050b951d0a21e60b08b6a9d17f7)
Hugo Locurcio 5 年之前
父节点
当前提交
b79bcb1f33
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      editor/plugins/sprite_frames_editor_plugin.cpp

+ 6 - 1
editor/plugins/sprite_frames_editor_plugin.cpp

@@ -927,11 +927,16 @@ SpriteFramesEditor::SpriteFramesEditor() {
 	animations->connect("item_edited", this, "_animation_name_edited");
 	animations->connect("item_edited", this, "_animation_name_edited");
 	animations->set_allow_reselect(true);
 	animations->set_allow_reselect(true);
 
 
+	HBoxContainer *hbc_anim_speed = memnew(HBoxContainer);
+	hbc_anim_speed->add_child(memnew(Label(TTR("Speed:"))));
+	vbc_animlist->add_child(hbc_anim_speed);
 	anim_speed = memnew(SpinBox);
 	anim_speed = memnew(SpinBox);
-	vbc_animlist->add_margin_child(TTR("Speed (FPS):"), anim_speed);
+	anim_speed->set_suffix(TTR("FPS"));
 	anim_speed->set_min(0);
 	anim_speed->set_min(0);
 	anim_speed->set_max(100);
 	anim_speed->set_max(100);
 	anim_speed->set_step(0.01);
 	anim_speed->set_step(0.01);
+	anim_speed->set_h_size_flags(SIZE_EXPAND_FILL);
+	hbc_anim_speed->add_child(anim_speed);
 	anim_speed->connect("value_changed", this, "_animation_fps_changed");
 	anim_speed->connect("value_changed", this, "_animation_fps_changed");
 
 
 	anim_loop = memnew(CheckButton);
 	anim_loop = memnew(CheckButton);