From 13229031eddb5994a03bf74baab6dee3d3104742 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 2 Feb 2022 02:51:43 +0200 Subject: [PATCH] Turn zen mode off when switching between layouts --- assets/layouts/default.tres | 12 ++++++++++++ src/UI/TopMenuContainer.gd | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/assets/layouts/default.tres b/assets/layouts/default.tres index c125278bc..4edd3a39c 100644 --- a/assets/layouts/default.tres +++ b/assets/layouts/default.tres @@ -5,21 +5,25 @@ [ext_resource path="res://addons/dockable_container/layout.gd" type="Script" id=3] [sub_resource type="Resource" id=1] +resource_name = "Tabs" script = ExtResource( 1 ) names = PoolStringArray( "Tools" ) current_tab = 0 [sub_resource type="Resource" id=8] +resource_name = "Tabs" script = ExtResource( 1 ) names = PoolStringArray( "Main Canvas" ) current_tab = 0 [sub_resource type="Resource" id=9] +resource_name = "Tabs" script = ExtResource( 1 ) names = PoolStringArray( "Animation Timeline" ) current_tab = 0 [sub_resource type="Resource" id=10] +resource_name = "Split" script = ExtResource( 2 ) direction = 1 percent = 0.882812 @@ -27,16 +31,19 @@ first = SubResource( 8 ) second = SubResource( 9 ) [sub_resource type="Resource" id=11] +resource_name = "Tabs" script = ExtResource( 1 ) names = PoolStringArray( "Canvas Preview" ) current_tab = 0 [sub_resource type="Resource" id=23] +resource_name = "Tabs" script = ExtResource( 1 ) names = PoolStringArray( "Color Pickers" ) current_tab = 0 [sub_resource type="Resource" id=24] +resource_name = "Split" script = ExtResource( 2 ) direction = 1 percent = 0.0 @@ -64,6 +71,7 @@ first = SubResource( 25 ) second = SubResource( 26 ) [sub_resource type="Resource" id=21] +resource_name = "Split" script = ExtResource( 2 ) direction = 1 percent = 0.182692 @@ -71,11 +79,13 @@ first = SubResource( 24 ) second = SubResource( 27 ) [sub_resource type="Resource" id=13] +resource_name = "Tabs" script = ExtResource( 1 ) names = PoolStringArray( "Palette Panel" ) current_tab = 0 [sub_resource type="Resource" id=15] +resource_name = "Split" script = ExtResource( 2 ) direction = 1 percent = 1.0 @@ -83,6 +93,7 @@ first = SubResource( 21 ) second = SubResource( 13 ) [sub_resource type="Resource" id=16] +resource_name = "Split" script = ExtResource( 2 ) direction = 0 percent = 0.972488 @@ -90,6 +101,7 @@ first = SubResource( 10 ) second = SubResource( 15 ) [sub_resource type="Resource" id=5] +resource_name = "Split" script = ExtResource( 2 ) direction = 0 percent = 0.00695249 diff --git a/src/UI/TopMenuContainer.gd b/src/UI/TopMenuContainer.gd index 8867aa2ac..9e0fe7f82 100644 --- a/src/UI/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer.gd @@ -435,6 +435,7 @@ func _dockers_submenu_id_pressed(id: int) -> void: func _layouts_submenu_id_pressed(id: int) -> void: + # Clone is needed so that the premade layouts do not get modified Global.control.ui.layout = layouts[id][1].clone() for i in layouts.size(): layouts_submenu.set_item_checked(i, i == id) @@ -442,6 +443,10 @@ func _layouts_submenu_id_pressed(id: int) -> void: for i in ui_elements.size(): dockers_submenu.set_item_checked(i, true) + Global.control.find_node("TabsContainer").visible = true + zen_mode = false + view_menu.set_item_checked(ViewMenuId.ZEN_MODE, false) + func _toggle_mirror_view() -> void: Global.mirror_view = !Global.mirror_view