Skip to content

Commit 64b4598

Browse files
Improve Android editor layout
1 parent 6a6a116 commit 64b4598

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

editor/editor_node.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7426,21 +7426,27 @@ EditorNode::EditorNode() {
74267426
main_vbox = memnew(VBoxContainer);
74277427

74287428
#ifdef ANDROID_ENABLED
7429-
main_hbox = memnew(HBoxContainer);
7430-
main_hbox->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
7429+
base_vbox = memnew(VBoxContainer);
7430+
base_vbox->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, theme->get_constant(SNAME("window_border_margin"), EditorStringName(Editor)));
7431+
7432+
title_bar = memnew(EditorTitleBar);
7433+
base_vbox->add_child(title_bar);
74317434

7435+
main_hbox = memnew(HBoxContainer);
74327436
main_hbox->add_child(main_vbox);
74337437
main_vbox->set_h_size_flags(Control::SIZE_EXPAND_FILL);
7438+
main_hbox->set_v_size_flags(Control::SIZE_EXPAND_FILL);
7439+
base_vbox->add_child(main_hbox);
74347440

74357441
_touch_actions_panel_mode_changed();
74367442

7437-
gui_base->add_child(main_hbox);
7443+
gui_base->add_child(base_vbox);
74387444
#else
74397445
gui_base->add_child(main_vbox);
7440-
#endif
74417446

74427447
title_bar = memnew(EditorTitleBar);
74437448
main_vbox->add_child(title_bar);
7449+
#endif
74447450

74457451
left_l_hsplit = memnew(DockSplitContainer);
74467452
left_l_hsplit->set_name("DockHSplitLeftL");

editor/editor_node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ class EditorNode : public Node {
282282
OptionButton *renderer = nullptr;
283283

284284
#ifdef ANDROID_ENABLED
285-
HBoxContainer *main_hbox = nullptr; // Only created on Android for TouchActionsPanel.
285+
VBoxContainer *base_vbox = nullptr; // It only contains the title_bar and main_hbox.
286+
HBoxContainer *main_hbox = nullptr; // It only contains the touch_actions_panel and main_vbox.
286287
TouchActionsPanel *touch_actions_panel = nullptr;
287288
void _touch_actions_panel_mode_changed();
288289
#endif

0 commit comments

Comments
 (0)