[gd_scene load_steps=7 format=3 uid="uid://d1phd84dk4t5e"]

[ext_resource type="Script" path="res://src/UI/Dialogs/ManageLayouts.gd" id="1"]
[ext_resource type="Script" path="res://addons/dockable_container/layout_panel.gd" id="2"]
[ext_resource type="Script" path="res://addons/dockable_container/layout.gd" id="3"]
[ext_resource type="Script" path="res://addons/dockable_container/dockable_container.gd" id="4"]

[sub_resource type="Resource" id="1"]
resource_name = "Tabs"
script = ExtResource("2")
names = PackedStringArray()
current_tab = -1

[sub_resource type="Resource" id="2"]
resource_name = "Layout"
script = ExtResource("3")
root = SubResource("1")
hidden_tabs = {}

[node name="ManageLayouts" type="AcceptDialog"]
title = "Manage Layouts"
exclusive = false
popup_window = true
script = ExtResource("1")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -36.0

[node name="PreviewHeader" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0

[node name="Label" type="Label" parent="VBoxContainer/PreviewHeader"]
layout_mode = 2
theme_type_variation = &"HeaderSmall"
text = "Preview"

[node name="HSeparator" type="HSeparator" parent="VBoxContainer/PreviewHeader"]
layout_mode = 2
size_flags_horizontal = 3

[node name="PreviewInstruction" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "This is a preview, changing this won't change the layout"

[node name="PreviewContainer" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3

[node name="LayoutPreview" type="Container" parent="VBoxContainer/PreviewContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("4")
tabs_visible = false
layout = SubResource("2")

[node name="LayoutsHeader" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0

[node name="Label" type="Label" parent="VBoxContainer/LayoutsHeader"]
layout_mode = 2
theme_type_variation = &"HeaderSmall"
text = "Layouts"

[node name="HSeparator" type="HSeparator" parent="VBoxContainer/LayoutsHeader"]
layout_mode = 2
size_flags_horizontal = 3

[node name="LayoutInstruction" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Double click to set as new startup layout"

[node name="SavedLayouts" type="ItemList" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 100)
layout_mode = 2

[node name="ButtonsContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2

[node name="AddLayout" type="Button" parent="VBoxContainer/ButtonsContainer"]
layout_mode = 2
size_flags_horizontal = 0
mouse_default_cursor_shape = 2
text = "Add"

[node name="EditLayout" type="Button" parent="VBoxContainer/ButtonsContainer"]
layout_mode = 2
size_flags_horizontal = 0
mouse_default_cursor_shape = 2
disabled = true
text = "Edit"

[node name="DeleteLayout" type="Button" parent="VBoxContainer/ButtonsContainer"]
layout_mode = 2
size_flags_horizontal = 0
mouse_default_cursor_shape = 2
disabled = true
text = "Delete"

[node name="LayoutSettings" type="ConfirmationDialog" parent="."]

[node name="LayoutName" type="LineEdit" parent="LayoutSettings"]
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = 8.0
offset_top = -26.0
offset_right = -8.0
offset_bottom = -2.0
size_flags_horizontal = 3
placeholder_text = "Insert name"

[node name="DeleteConfirmation" type="ConfirmationDialog" parent="."]
dialog_text = "Are you sure you want to delete this layout?"

[connection signal="about_to_popup" from="." to="." method="_on_ManageLayouts_about_to_show"]
[connection signal="visibility_changed" from="." to="." method="_on_ManageLayouts_visibility_changed"]
[connection signal="empty_clicked" from="VBoxContainer/SavedLayouts" to="." method="_on_SavedLayouts_empty_clicked"]
[connection signal="item_activated" from="VBoxContainer/SavedLayouts" to="." method="_on_SavedLayouts_item_activated"]
[connection signal="item_selected" from="VBoxContainer/SavedLayouts" to="." method="_on_SavedLayouts_item_selected"]
[connection signal="pressed" from="VBoxContainer/ButtonsContainer/AddLayout" to="." method="_on_AddLayout_pressed"]
[connection signal="pressed" from="VBoxContainer/ButtonsContainer/EditLayout" to="." method="_on_EditLayout_pressed"]
[connection signal="pressed" from="VBoxContainer/ButtonsContainer/DeleteLayout" to="." method="_on_DeleteLayout_pressed"]
[connection signal="confirmed" from="LayoutSettings" to="." method="_on_LayoutSettings_confirmed"]
[connection signal="confirmed" from="DeleteConfirmation" to="." method="_on_DeleteConfirmation_confirmed"]
