1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

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"
This commit is contained in:
Variable 2021-05-10 20:05:15 +05:00 committed by GitHub
parent 70d5fad9fd
commit 729c3ae1af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View file

@ -81,6 +81,9 @@ func change_ui_layout(mode : String) -> void:
if mode == "tallscreen" and not tallscreen_is_active: if mode == "tallscreen" and not tallscreen_is_active:
tallscreen_is_active = true 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) reparent_node_to(right_panel, bottom_panel, 0)
right_panel.rect_min_size.y = 300 right_panel.rect_min_size.y = 300
reparent_node_to(canvas_preview_container, tool_and_palette_vsplit, 1) 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) reparent_node_to(tool_panel, ui.get_node("CanvasAndTimeline/HBoxContainer"), 0)
elif mode == "widescreen" and tallscreen_is_active: elif mode == "widescreen" and tallscreen_is_active:
tallscreen_is_active = false 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) reparent_node_to(right_panel, ui, -1)
right_panel.rect_min_size.y = 0 right_panel.rect_min_size.y = 0
reparent_node_to(canvas_preview_container, right_panel.get_node("PreviewAndPalettes"), 0) reparent_node_to(canvas_preview_container, right_panel.get_node("PreviewAndPalettes"), 0)

View file

@ -424,6 +424,7 @@ func toggle_zen_mode() -> void:
Global.tool_panel.visible = zen_mode Global.tool_panel.visible = zen_mode
Global.right_panel.visible = zen_mode Global.right_panel.visible = zen_mode
Global.tabs_container.visible = zen_mode Global.tabs_container.visible = zen_mode
Global.control.get_node("MenuAndUI/UI/CanvasAndTimeline/HBoxContainer").visible = zen_mode
zen_mode = !zen_mode zen_mode = !zen_mode
view_menu.set_item_checked(ViewMenuId.ZEN_MODE, zen_mode) view_menu.set_item_checked(ViewMenuId.ZEN_MODE, zen_mode)

View file

@ -432,6 +432,7 @@ margin_right = 950.0
margin_bottom = 692.0 margin_bottom = 692.0
size_flags_horizontal = 3 size_flags_horizontal = 3
custom_constants/autohide = 0 custom_constants/autohide = 0
split_offset = 278
[node name="ViewportAndRulers" type="VBoxContainer" parent="CanvasAndTimeline"] [node name="ViewportAndRulers" type="VBoxContainer" parent="CanvasAndTimeline"]
margin_right = 902.0 margin_right = 902.0
@ -539,7 +540,14 @@ current = true
zoom = Vector2( 0.15, 0.15 ) zoom = Vector2( 0.15, 0.15 )
script = ExtResource( 7 ) 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"] [node name="HBoxContainer" type="HBoxContainer" parent="CanvasAndTimeline"]
visible = false
margin_top = 492.0 margin_top = 492.0
margin_right = 902.0 margin_right = 902.0
margin_bottom = 692.0 margin_bottom = 692.0
@ -552,12 +560,6 @@ size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
custom_constants/autohide = 0 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="."] [node name="RightPanel" type="Panel" parent="."]
margin_left = 950.0 margin_left = 950.0
margin_right = 1280.0 margin_right = 1280.0