From 729c3ae1af5b5c53a6723081965f9411a21112b8 Mon Sep 17 00:00:00 2001 From: Variable <77773850+Variable-ind@users.noreply.github.com> Date: Mon, 10 May 2021 20:05:15 +0500 Subject: [PATCH] Tall wide screen corrections (#478) * a minor visibility change. made the nodes that were not needed in wide-screen "Invicible" the visibility will now be controlled procedurally * Added some lines of code in "change_ui_layout()" The added lines will control node visibility changes to adjust to current screen mode * added a line to fix tall-screen "zen-mode" --- src/Main.gd | 6 ++++++ src/UI/TopMenuContainer.gd | 1 + src/UI/UI.tscn | 14 ++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Main.gd b/src/Main.gd index 91ffd5c48..32660f105 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -81,6 +81,9 @@ func change_ui_layout(mode : String) -> void: if mode == "tallscreen" and not tallscreen_is_active: tallscreen_is_active = true + # changing visibility and re-parenting of nodes for tall screen + ui.get_node("CanvasAndTimeline/HBoxContainer").visible = true + reparent_node_to(Global.animation_timeline, ui.get_node("CanvasAndTimeline/HBoxContainer/BottomPanel"), 0) reparent_node_to(right_panel, bottom_panel, 0) right_panel.rect_min_size.y = 300 reparent_node_to(canvas_preview_container, tool_and_palette_vsplit, 1) @@ -89,6 +92,9 @@ func change_ui_layout(mode : String) -> void: reparent_node_to(tool_panel, ui.get_node("CanvasAndTimeline/HBoxContainer"), 0) elif mode == "widescreen" and tallscreen_is_active: tallscreen_is_active = false + # Reparenting and hiding nodes to adjust wide-screen + reparent_node_to(Global.animation_timeline, ui.get_node("CanvasAndTimeline"), 1) + ui.get_node("CanvasAndTimeline/HBoxContainer").visible = false reparent_node_to(right_panel, ui, -1) right_panel.rect_min_size.y = 0 reparent_node_to(canvas_preview_container, right_panel.get_node("PreviewAndPalettes"), 0) diff --git a/src/UI/TopMenuContainer.gd b/src/UI/TopMenuContainer.gd index 436fa275d..90d937fc8 100644 --- a/src/UI/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer.gd @@ -424,6 +424,7 @@ func toggle_zen_mode() -> void: Global.tool_panel.visible = zen_mode Global.right_panel.visible = zen_mode Global.tabs_container.visible = zen_mode + Global.control.get_node("MenuAndUI/UI/CanvasAndTimeline/HBoxContainer").visible = zen_mode zen_mode = !zen_mode view_menu.set_item_checked(ViewMenuId.ZEN_MODE, zen_mode) diff --git a/src/UI/UI.tscn b/src/UI/UI.tscn index 59b217c04..d47877c28 100644 --- a/src/UI/UI.tscn +++ b/src/UI/UI.tscn @@ -432,6 +432,7 @@ margin_right = 950.0 margin_bottom = 692.0 size_flags_horizontal = 3 custom_constants/autohide = 0 +split_offset = 278 [node name="ViewportAndRulers" type="VBoxContainer" parent="CanvasAndTimeline"] margin_right = 902.0 @@ -539,7 +540,14 @@ current = true zoom = Vector2( 0.15, 0.15 ) script = ExtResource( 7 ) +[node name="AnimationTimeline" parent="CanvasAndTimeline" instance=ExtResource( 18 )] +margin_top = 492.0 +margin_bottom = 692.0 +size_flags_vertical = 3 +custom_styles/panel = SubResource( 3 ) + [node name="HBoxContainer" type="HBoxContainer" parent="CanvasAndTimeline"] +visible = false margin_top = 492.0 margin_right = 902.0 margin_bottom = 692.0 @@ -552,12 +560,6 @@ size_flags_horizontal = 3 size_flags_vertical = 3 custom_constants/autohide = 0 -[node name="AnimationTimeline" parent="CanvasAndTimeline/HBoxContainer/BottomPanel" instance=ExtResource( 18 )] -margin_top = 0.0 -margin_bottom = 200.0 -size_flags_vertical = 3 -custom_styles/panel = SubResource( 3 ) - [node name="RightPanel" type="Panel" parent="."] margin_left = 950.0 margin_right = 1280.0