Merge pull request #98224 from timothyqiu/select-markers-dialog

Improve Select Markers dialog in AnimationTree editor
This commit is contained in:
Thaddeus Crews 2024-11-12 09:27:53 -06:00
commit 847059503f
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -45,6 +45,7 @@
#include "scene/3d/skeleton_3d.h" #include "scene/3d/skeleton_3d.h"
#include "scene/animation/animation_player.h" #include "scene/animation/animation_player.h"
#include "scene/gui/check_box.h" #include "scene/gui/check_box.h"
#include "scene/gui/grid_container.h"
#include "scene/gui/menu_button.h" #include "scene/gui/menu_button.h"
#include "scene/gui/option_button.h" #include "scene/gui/option_button.h"
#include "scene/gui/panel.h" #include "scene/gui/panel.h"
@ -1397,32 +1398,30 @@ bool EditorInspectorPluginAnimationNodeAnimation::parse_property(Object *p_objec
} }
AnimationNodeAnimationEditorDialog::AnimationNodeAnimationEditorDialog() { AnimationNodeAnimationEditorDialog::AnimationNodeAnimationEditorDialog() {
set_title(TTR("Select Markers...")); set_title(TTR("Select Markers"));
VBoxContainer *vbox = memnew(VBoxContainer);
add_child(vbox);
vbox->set_offsets_preset(Control::PRESET_FULL_RECT);
HBoxContainer *container_start = memnew(HBoxContainer); GridContainer *grid = memnew(GridContainer);
vbox->add_child(container_start); grid->set_columns(2);
Label *label_start = memnew(Label); grid->set_offsets_preset(Control::PRESET_FULL_RECT);
container_start->add_child(label_start); add_child(grid);
Label *label_start = memnew(Label(TTR("Start Marker")));
grid->add_child(label_start);
label_start->set_h_size_flags(Control::SIZE_EXPAND_FILL); label_start->set_h_size_flags(Control::SIZE_EXPAND_FILL);
label_start->set_stretch_ratio(1); label_start->set_stretch_ratio(1);
label_start->set_text(TTR("Start Marker"));
select_start = memnew(OptionButton); select_start = memnew(OptionButton);
container_start->add_child(select_start); select_start->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
grid->add_child(select_start);
select_start->set_h_size_flags(Control::SIZE_EXPAND_FILL); select_start->set_h_size_flags(Control::SIZE_EXPAND_FILL);
select_start->set_stretch_ratio(2); select_start->set_stretch_ratio(2);
HBoxContainer *container_end = memnew(HBoxContainer); Label *label_end = memnew(Label(TTR("End Marker")));
vbox->add_child(container_end); grid->add_child(label_end);
Label *label_end = memnew(Label);
container_end->add_child(label_end);
label_end->set_h_size_flags(Control::SIZE_EXPAND_FILL); label_end->set_h_size_flags(Control::SIZE_EXPAND_FILL);
label_end->set_stretch_ratio(1); label_end->set_stretch_ratio(1);
label_end->set_text(TTR("End Marker"));
select_end = memnew(OptionButton); select_end = memnew(OptionButton);
container_end->add_child(select_end); select_end->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
grid->add_child(select_end);
select_end->set_h_size_flags(Control::SIZE_EXPAND_FILL); select_end->set_h_size_flags(Control::SIZE_EXPAND_FILL);
select_end->set_stretch_ratio(2); select_end->set_stretch_ratio(2);
} }