Skip to content

Commit b0ae6f7

Browse files
Fix gui overflow in Android editor
1 parent aa65940 commit b0ae6f7

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

editor/animation_track_editor.cpp

+27-21
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include "scene/animation/tween.h"
5151
#include "scene/gui/check_box.h"
5252
#include "scene/gui/color_picker.h"
53+
#include "scene/gui/flow_container.h"
5354
#include "scene/gui/grid_container.h"
5455
#include "scene/gui/option_button.h"
5556
#include "scene/gui/panel_container.h"
@@ -7606,31 +7607,34 @@ AnimationTrackEditor::AnimationTrackEditor() {
76067607
track_vbox->set_h_size_flags(SIZE_EXPAND_FILL);
76077608
scroll->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
76087609

7609-
HBoxContainer *bottom_hb = memnew(HBoxContainer);
7610-
add_child(bottom_hb);
7610+
HFlowContainer *bottom_hf = memnew(HFlowContainer);
7611+
add_child(bottom_hf);
76117612

76127613
imported_anim_warning = memnew(Button);
76137614
imported_anim_warning->hide();
76147615
imported_anim_warning->set_text(TTR("Imported Scene"));
76157616
imported_anim_warning->set_tooltip_text(TTR("Warning: Editing imported animation"));
76167617
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);
76187619

76197620
dummy_player_warning = memnew(Button);
76207621
dummy_player_warning->hide();
76217622
dummy_player_warning->set_text(TTR("Dummy Player"));
76227623
dummy_player_warning->set_tooltip_text(TTR("Warning: Editing dummy AnimationPlayer"));
76237624
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);
76257626

76267627
inactive_player_warning = memnew(Button);
76277628
inactive_player_warning->hide();
76287629
inactive_player_warning->set_text(TTR("Inactive Player"));
76297630
inactive_player_warning->set_tooltip_text(TTR("Warning: AnimationPlayer is inactive"));
76307631
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);
76327633

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);
76347638

76357639
bezier_edit_icon = memnew(Button);
76367640
bezier_edit_icon->set_flat(true);
@@ -7639,52 +7643,52 @@ AnimationTrackEditor::AnimationTrackEditor() {
76397643
bezier_edit_icon->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_toggle_bezier_edit));
76407644
bezier_edit_icon->set_tooltip_text(TTR("Toggle between the bezier curve editor and track editor."));
76417645

7642-
bottom_hb->add_child(bezier_edit_icon);
7646+
bottom_hf->add_child(bezier_edit_icon);
76437647

76447648
selected_filter = memnew(Button);
76457649
selected_filter->set_flat(true);
76467650
selected_filter->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); // Same function works the same.
76477651
selected_filter->set_toggle_mode(true);
76487652
selected_filter->set_tooltip_text(TTR("Only show tracks from nodes selected in tree."));
76497653

7650-
bottom_hb->add_child(selected_filter);
7654+
bottom_hf->add_child(selected_filter);
76517655

76527656
view_group = memnew(Button);
76537657
view_group->set_flat(true);
76547658
view_group->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_view_group_toggle));
76557659
view_group->set_toggle_mode(true);
76567660
view_group->set_tooltip_text(TTR("Group tracks by node or display them as plain list."));
76577661

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));
76607664

76617665
snap_timeline = memnew(Button);
76627666
snap_timeline->set_flat(true);
7663-
bottom_hb->add_child(snap_timeline);
7667+
bottom_hf->add_child(snap_timeline);
76647668
snap_timeline->set_disabled(true);
76657669
snap_timeline->set_toggle_mode(true);
76667670
snap_timeline->set_pressed(false);
76677671
snap_timeline->set_tooltip_text(TTR("Apply snapping to timeline cursor."));
76687672

76697673
snap_keys = memnew(Button);
76707674
snap_keys->set_flat(true);
7671-
bottom_hb->add_child(snap_keys);
7675+
bottom_hf->add_child(snap_keys);
76727676
snap_keys->set_disabled(true);
76737677
snap_keys->set_toggle_mode(true);
76747678
snap_keys->set_pressed(true);
76757679
snap_keys->set_tooltip_text(TTR("Apply snapping to selected key(s)."));
76767680

76777681
fps_compat = memnew(Button);
76787682
fps_compat->set_flat(true);
7679-
bottom_hb->add_child(fps_compat);
7683+
bottom_hf->add_child(fps_compat);
76807684
fps_compat->set_disabled(true);
76817685
fps_compat->set_toggle_mode(true);
76827686
fps_compat->set_pressed(true);
76837687
fps_compat->set_tooltip_text(TTR("Apply snapping to the nearest integer FPS."));
76847688
fps_compat->connect(SceneStringName(toggled), callable_mp(this, &AnimationTrackEditor::_update_fps_compat_mode));
76857689

76867690
nearest_fps_label = memnew(Label);
7687-
bottom_hb->add_child(nearest_fps_label);
7691+
bottom_hf->add_child(nearest_fps_label);
76887692

76897693
step = memnew(EditorSpinSlider);
76907694
step->set_min(0);
@@ -7693,30 +7697,32 @@ AnimationTrackEditor::AnimationTrackEditor() {
76937697
step->set_hide_slider(true);
76947698
step->set_custom_minimum_size(Size2(100, 0) * EDSCALE);
76957699
step->set_tooltip_text(TTR("Animation step value."));
7696-
bottom_hb->add_child(step);
7700+
bottom_hf->add_child(step);
76977701
step->connect(SceneStringName(value_changed), callable_mp(this, &AnimationTrackEditor::_update_step));
76987702
step->set_read_only(true);
76997703

77007704
snap_mode = memnew(OptionButton);
77017705
snap_mode->add_item(TTR("Seconds"));
77027706
snap_mode->add_item(TTR("FPS"));
7703-
bottom_hb->add_child(snap_mode);
7707+
bottom_hf->add_child(snap_mode);
77047708
snap_mode->connect(SceneStringName(item_selected), callable_mp(this, &AnimationTrackEditor::_snap_mode_changed));
77057709
snap_mode->set_disabled(true);
77067710

7707-
bottom_hb->add_child(memnew(VSeparator));
7711+
bottom_hf->add_child(memnew(VSeparator));
77087712

7713+
HBoxContainer *zoom_hb = memnew(HBoxContainer);
77097714
zoom_icon = memnew(TextureRect);
77107715
zoom_icon->set_v_size_flags(SIZE_SHRINK_CENTER);
7711-
bottom_hb->add_child(zoom_icon);
7716+
zoom_hb->add_child(zoom_icon);
77127717
zoom = memnew(HSlider);
77137718
zoom->set_step(0.01);
77147719
zoom->set_min(0.0);
77157720
zoom->set_max(2.0);
77167721
zoom->set_value(1.0);
77177722
zoom->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
77187723
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);
77207726
timeline->set_zoom(zoom);
77217727

77227728
ED_SHORTCUT("animation_editor/auto_fit", TTRC("Fit to panel"), KeyModifierMask::ALT | Key::F);
@@ -7725,14 +7731,14 @@ AnimationTrackEditor::AnimationTrackEditor() {
77257731
auto_fit->set_flat(true);
77267732
auto_fit->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit));
77277733
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);
77297735

77307736
auto_fit_bezier = memnew(Button);
77317737
auto_fit_bezier->set_flat(true);
77327738
auto_fit_bezier->set_visible(false);
77337739
auto_fit_bezier->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit_bezier));
77347740
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);
77367742

77377743
edit = memnew(MenuButton);
77387744
edit->set_shortcut_context(this);

0 commit comments

Comments
 (0)