[gd_scene load_steps=5 format=3 uid="uid://bn4aw27dj7pwi"]

[ext_resource type="Script" path="res://src/UI/Nodes/GradientEdit.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://cis71foi5jt31" path="res://assets/graphics/misc/settings.svg" id="2_2dyyb"]
[ext_resource type="Script" path="res://src/UI/Nodes/Sliders/ValueSlider.gd" id="2_y6708"]
[ext_resource type="Texture2D" uid="uid://cvc120a27s57m" path="res://assets/graphics/misc/save.svg" id="4_b5s6b"]

[node name="GradientEdit" type="VBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource("1")

[node name="InterpolationContainer" type="HBoxContainer" parent="."]
layout_mode = 2

[node name="OffsetValueSlider" type="TextureProgressBar" parent="InterpolationContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(64, 0)
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
max_value = 1.0
step = 0.001
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("2_y6708")
snap_step = 0.1

[node name="InterpolationOptionButton" type="OptionButton" parent="InterpolationContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "Interpolation"
mouse_default_cursor_shape = 2
selected = 0
fit_to_longest_item = false
item_count = 3
popup/item_0/text = "Linear"
popup/item_1/text = "Constant"
popup/item_1/id = 1
popup/item_2/text = "Cubic"
popup/item_2/id = 2

[node name="ColorSpaceOptionButton" type="OptionButton" parent="InterpolationContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
tooltip_text = "Color space"
mouse_default_cursor_shape = 2
selected = 0
fit_to_longest_item = false
item_count = 3
popup/item_0/text = "sRGB"
popup/item_1/text = "Linear sRGB"
popup/item_1/id = 1
popup/item_2/text = "Oklab"
popup/item_2/id = 2

[node name="ToolsMenuButton" type="MenuButton" parent="InterpolationContainer"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Tools"
mouse_default_cursor_shape = 2
icon = ExtResource("2_2dyyb")
flat = false
icon_alignment = 1
item_count = 3
popup/item_0/text = "Reverse"
popup/item_1/text = "Evenly distribute points"
popup/item_1/id = 1
popup/item_2/text = "Divide into equal parts"
popup/item_2/id = 2

[node name="SaveToPresetsButton" type="Button" parent="InterpolationContainer"]
layout_mode = 2
tooltip_text = "Save to presets"
mouse_default_cursor_shape = 2
icon = ExtResource("4_b5s6b")

[node name="PresetListButton" type="Button" parent="InterpolationContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
text = "Presets"

[node name="PopupPanel" type="PopupPanel" parent="InterpolationContainer/PresetListButton"]

[node name="ScrollContainer" type="ScrollContainer" parent="InterpolationContainer/PresetListButton/PopupPanel"]
custom_minimum_size = Vector2(100, 150)
offset_left = 4.0
offset_top = 4.0
offset_right = 104.0
offset_bottom = 154.0

[node name="PresetsContainer" type="VBoxContainer" parent="InterpolationContainer/PresetListButton/PopupPanel/ScrollContainer"]
unique_name_in_owner = true
layout_mode = 2

[node name="TextureRect" type="TextureRect" parent="."]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
size_flags_vertical = 3
expand_mode = 1

[node name="Popup" type="PopupPanel" parent="."]
unresizable = false
borderless = false

[node name="ColorPicker" type="ColorPicker" parent="Popup"]
offset_left = 4.0
offset_top = 4.0
offset_right = 302.0
offset_bottom = 580.0

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

[node name="VBoxContainer" type="VBoxContainer" parent="DivideConfirmationDialog"]
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="HBoxContainer" type="HBoxContainer" parent="DivideConfirmationDialog/VBoxContainer"]
layout_mode = 2

[node name="Label" type="Label" parent="DivideConfirmationDialog/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Parts:"

[node name="NumberOfPartsSpinBox" type="SpinBox" parent="DivideConfirmationDialog/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
min_value = 2.0
value = 3.0
allow_greater = true

[node name="AddPointEndCheckBox" type="CheckBox" parent="DivideConfirmationDialog/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "If this is enabled, the last point gets added at the end of the gradient.
Disable this if you wish to convert the gradient to have constant interpolation, so that the last color will be taken into account."
mouse_default_cursor_shape = 2
text = "Add point at the end"

[connection signal="resized" from="." to="." method="_on_GradientEdit_resized"]
[connection signal="value_changed" from="InterpolationContainer/OffsetValueSlider" to="." method="_on_offset_value_slider_value_changed"]
[connection signal="item_selected" from="InterpolationContainer/InterpolationOptionButton" to="." method="_on_InterpolationOptionButton_item_selected"]
[connection signal="item_selected" from="InterpolationContainer/ColorSpaceOptionButton" to="." method="_on_color_space_option_button_item_selected"]
[connection signal="pressed" from="InterpolationContainer/SaveToPresetsButton" to="." method="_on_save_to_presets_button_pressed"]
[connection signal="pressed" from="InterpolationContainer/PresetListButton" to="." method="_on_preset_list_button_pressed"]
[connection signal="color_changed" from="Popup/ColorPicker" to="." method="_on_ColorPicker_color_changed"]
[connection signal="confirmed" from="DivideConfirmationDialog" to="." method="_on_DivideConfirmationDialog_confirmed"]
