50
50
#include " scene/animation/tween.h"
51
51
#include " scene/gui/check_box.h"
52
52
#include " scene/gui/color_picker.h"
53
+ #include " scene/gui/flow_container.h"
53
54
#include " scene/gui/grid_container.h"
54
55
#include " scene/gui/option_button.h"
55
56
#include " scene/gui/panel_container.h"
@@ -7606,31 +7607,34 @@ AnimationTrackEditor::AnimationTrackEditor() {
7606
7607
track_vbox->set_h_size_flags (SIZE_EXPAND_FILL);
7607
7608
scroll->set_horizontal_scroll_mode (ScrollContainer::SCROLL_MODE_DISABLED);
7608
7609
7609
- HBoxContainer *bottom_hb = memnew (HBoxContainer );
7610
- add_child (bottom_hb );
7610
+ HFlowContainer *bottom_hf = memnew (HFlowContainer );
7611
+ add_child (bottom_hf );
7611
7612
7612
7613
imported_anim_warning = memnew (Button );
7613
7614
imported_anim_warning->hide ();
7614
7615
imported_anim_warning->set_text (TTR (" Imported Scene" ));
7615
7616
imported_anim_warning->set_tooltip_text (TTR (" Warning: Editing imported animation" ));
7616
7617
imported_anim_warning->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_show_imported_anim_warning));
7617
- bottom_hb ->add_child (imported_anim_warning);
7618
+ bottom_hf ->add_child (imported_anim_warning);
7618
7619
7619
7620
dummy_player_warning = memnew (Button );
7620
7621
dummy_player_warning->hide ();
7621
7622
dummy_player_warning->set_text (TTR (" Dummy Player" ));
7622
7623
dummy_player_warning->set_tooltip_text (TTR (" Warning: Editing dummy AnimationPlayer" ));
7623
7624
dummy_player_warning->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_show_dummy_player_warning));
7624
- bottom_hb ->add_child (dummy_player_warning);
7625
+ bottom_hf ->add_child (dummy_player_warning);
7625
7626
7626
7627
inactive_player_warning = memnew (Button );
7627
7628
inactive_player_warning->hide ();
7628
7629
inactive_player_warning->set_text (TTR (" Inactive Player" ));
7629
7630
inactive_player_warning->set_tooltip_text (TTR (" Warning: AnimationPlayer is inactive" ));
7630
7631
inactive_player_warning->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_show_inactive_player_warning));
7631
- bottom_hb ->add_child (inactive_player_warning);
7632
+ bottom_hf ->add_child (inactive_player_warning);
7632
7633
7633
- bottom_hb->add_spacer ();
7634
+ Control *spacer = memnew (Control);
7635
+ spacer->set_mouse_filter (MOUSE_FILTER_PASS);
7636
+ spacer->set_h_size_flags (SIZE_EXPAND_FILL);
7637
+ bottom_hf->add_child (spacer);
7634
7638
7635
7639
bezier_edit_icon = memnew (Button );
7636
7640
bezier_edit_icon->set_flat (true );
@@ -7639,52 +7643,52 @@ AnimationTrackEditor::AnimationTrackEditor() {
7639
7643
bezier_edit_icon->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_toggle_bezier_edit));
7640
7644
bezier_edit_icon->set_tooltip_text (TTR (" Toggle between the bezier curve editor and track editor." ));
7641
7645
7642
- bottom_hb ->add_child (bezier_edit_icon);
7646
+ bottom_hf ->add_child (bezier_edit_icon);
7643
7647
7644
7648
selected_filter = memnew (Button );
7645
7649
selected_filter->set_flat (true );
7646
7650
selected_filter->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_view_group_toggle)); // Same function works the same.
7647
7651
selected_filter->set_toggle_mode (true );
7648
7652
selected_filter->set_tooltip_text (TTR (" Only show tracks from nodes selected in tree." ));
7649
7653
7650
- bottom_hb ->add_child (selected_filter);
7654
+ bottom_hf ->add_child (selected_filter);
7651
7655
7652
7656
view_group = memnew (Button );
7653
7657
view_group->set_flat (true );
7654
7658
view_group->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_view_group_toggle));
7655
7659
view_group->set_toggle_mode (true );
7656
7660
view_group->set_tooltip_text (TTR (" Group tracks by node or display them as plain list." ));
7657
7661
7658
- bottom_hb ->add_child (view_group);
7659
- bottom_hb ->add_child (memnew (VSeparator));
7662
+ bottom_hf ->add_child (view_group);
7663
+ bottom_hf ->add_child (memnew (VSeparator));
7660
7664
7661
7665
snap_timeline = memnew (Button );
7662
7666
snap_timeline->set_flat (true );
7663
- bottom_hb ->add_child (snap_timeline);
7667
+ bottom_hf ->add_child (snap_timeline);
7664
7668
snap_timeline->set_disabled (true );
7665
7669
snap_timeline->set_toggle_mode (true );
7666
7670
snap_timeline->set_pressed (false );
7667
7671
snap_timeline->set_tooltip_text (TTR (" Apply snapping to timeline cursor." ));
7668
7672
7669
7673
snap_keys = memnew (Button );
7670
7674
snap_keys->set_flat (true );
7671
- bottom_hb ->add_child (snap_keys);
7675
+ bottom_hf ->add_child (snap_keys);
7672
7676
snap_keys->set_disabled (true );
7673
7677
snap_keys->set_toggle_mode (true );
7674
7678
snap_keys->set_pressed (true );
7675
7679
snap_keys->set_tooltip_text (TTR (" Apply snapping to selected key(s)." ));
7676
7680
7677
7681
fps_compat = memnew (Button );
7678
7682
fps_compat->set_flat (true );
7679
- bottom_hb ->add_child (fps_compat);
7683
+ bottom_hf ->add_child (fps_compat);
7680
7684
fps_compat->set_disabled (true );
7681
7685
fps_compat->set_toggle_mode (true );
7682
7686
fps_compat->set_pressed (true );
7683
7687
fps_compat->set_tooltip_text (TTR (" Apply snapping to the nearest integer FPS." ));
7684
7688
fps_compat->connect (SceneStringName (toggled), callable_mp (this , &AnimationTrackEditor::_update_fps_compat_mode));
7685
7689
7686
7690
nearest_fps_label = memnew (Label);
7687
- bottom_hb ->add_child (nearest_fps_label);
7691
+ bottom_hf ->add_child (nearest_fps_label);
7688
7692
7689
7693
step = memnew (EditorSpinSlider);
7690
7694
step->set_min (0 );
@@ -7693,30 +7697,32 @@ AnimationTrackEditor::AnimationTrackEditor() {
7693
7697
step->set_hide_slider (true );
7694
7698
step->set_custom_minimum_size (Size2 (100 , 0 ) * EDSCALE);
7695
7699
step->set_tooltip_text (TTR (" Animation step value." ));
7696
- bottom_hb ->add_child (step);
7700
+ bottom_hf ->add_child (step);
7697
7701
step->connect (SceneStringName (value_changed), callable_mp (this , &AnimationTrackEditor::_update_step));
7698
7702
step->set_read_only (true );
7699
7703
7700
7704
snap_mode = memnew (OptionButton);
7701
7705
snap_mode->add_item (TTR (" Seconds" ));
7702
7706
snap_mode->add_item (TTR (" FPS" ));
7703
- bottom_hb ->add_child (snap_mode);
7707
+ bottom_hf ->add_child (snap_mode);
7704
7708
snap_mode->connect (SceneStringName (item_selected), callable_mp (this , &AnimationTrackEditor::_snap_mode_changed));
7705
7709
snap_mode->set_disabled (true );
7706
7710
7707
- bottom_hb ->add_child (memnew (VSeparator));
7711
+ bottom_hf ->add_child (memnew (VSeparator));
7708
7712
7713
+ HBoxContainer *zoom_hb = memnew (HBoxContainer);
7709
7714
zoom_icon = memnew (TextureRect);
7710
7715
zoom_icon->set_v_size_flags (SIZE_SHRINK_CENTER);
7711
- bottom_hb ->add_child (zoom_icon);
7716
+ zoom_hb ->add_child (zoom_icon);
7712
7717
zoom = memnew (HSlider);
7713
7718
zoom->set_step (0.01 );
7714
7719
zoom->set_min (0.0 );
7715
7720
zoom->set_max (2.0 );
7716
7721
zoom->set_value (1.0 );
7717
7722
zoom->set_custom_minimum_size (Size2 (200 , 0 ) * EDSCALE);
7718
7723
zoom->set_v_size_flags (SIZE_SHRINK_CENTER);
7719
- bottom_hb->add_child (zoom);
7724
+ zoom_hb->add_child (zoom);
7725
+ bottom_hf->add_child (zoom_hb);
7720
7726
timeline->set_zoom (zoom);
7721
7727
7722
7728
ED_SHORTCUT (" animation_editor/auto_fit" , TTRC (" Fit to panel" ), KeyModifierMask::ALT | Key::F);
@@ -7725,14 +7731,14 @@ AnimationTrackEditor::AnimationTrackEditor() {
7725
7731
auto_fit->set_flat (true );
7726
7732
auto_fit->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_auto_fit));
7727
7733
auto_fit->set_shortcut (ED_GET_SHORTCUT (" animation_editor/auto_fit" ));
7728
- bottom_hb ->add_child (auto_fit);
7734
+ bottom_hf ->add_child (auto_fit);
7729
7735
7730
7736
auto_fit_bezier = memnew (Button );
7731
7737
auto_fit_bezier->set_flat (true );
7732
7738
auto_fit_bezier->set_visible (false );
7733
7739
auto_fit_bezier->connect (SceneStringName (pressed), callable_mp (this , &AnimationTrackEditor::_auto_fit_bezier));
7734
7740
auto_fit_bezier->set_shortcut (ED_GET_SHORTCUT (" animation_editor/auto_fit" ));
7735
- bottom_hb ->add_child (auto_fit_bezier);
7741
+ bottom_hf ->add_child (auto_fit_bezier);
7736
7742
7737
7743
edit = memnew (MenuButton);
7738
7744
edit->set_shortcut_context (this );
0 commit comments