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

[ext_resource type="Script" path="res://src/UI/Dialogs/ImageEffects/ScaleImage.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://kd10jfc1dxf5" path="res://assets/graphics/misc/lock_aspect_guides.png" id="2"]
[ext_resource type="Texture2D" uid="uid://cancw70yw0pv7" path="res://assets/graphics/misc/lock_aspect_2.png" id="3"]
[ext_resource type="Texture2D" uid="uid://beqermx8s5q8y" path="res://assets/graphics/misc/lock_aspect.png" id="4"]

[node name="ScaleImage" type="ConfirmationDialog"]
title = "Scale Image"
size = Vector2i(206, 325)
script = ExtResource("1")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
offset_left = 8.0
offset_top = 8.0
offset_right = 198.0
offset_bottom = 276.0
size_flags_horizontal = 3

[node name="ImageSize" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Image Size"

[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
layout_mode = 2

[node name="PixelsLabel" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Pixels"

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

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

[node name="WidthContainer" type="HBoxContainer" parent="VBoxContainer/SizeContainer/VBoxContainer"]
layout_mode = 2

[node name="WidthLabel" type="Label" parent="VBoxContainer/SizeContainer/VBoxContainer/WidthContainer"]
custom_minimum_size = Vector2(90, 0)
layout_mode = 2
text = "Width:"

[node name="WidthValue" type="SpinBox" parent="VBoxContainer/SizeContainer/VBoxContainer/WidthContainer"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
value = 64.0
suffix = "px"

[node name="HeightContainer" type="HBoxContainer" parent="VBoxContainer/SizeContainer/VBoxContainer"]
layout_mode = 2

[node name="Height" type="Label" parent="VBoxContainer/SizeContainer/VBoxContainer/HeightContainer"]
custom_minimum_size = Vector2(90, 0)
layout_mode = 2
text = "Height:"

[node name="HeightValue" type="SpinBox" parent="VBoxContainer/SizeContainer/VBoxContainer/HeightContainer"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
value = 64.0
suffix = "px"

[node name="TextureRect" type="TextureRect" parent="VBoxContainer/SizeContainer" groups=["UIButtons"]]
layout_mode = 2
texture = ExtResource("2")

[node name="AspectRatioButton" type="TextureButton" parent="VBoxContainer/SizeContainer/TextureRect" groups=["UIButtons"]]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -4.5
offset_top = -9.0
offset_right = 11.5
offset_bottom = 7.0
tooltip_text = "Lock aspect ratio"
mouse_default_cursor_shape = 2
toggle_mode = true
button_pressed = true
texture_normal = ExtResource("3")
texture_pressed = ExtResource("4")

[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
layout_mode = 2

[node name="PercentageLabel" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Percentage"

[node name="PercentageContainer" type="VBoxContainer" parent="VBoxContainer"]
layout_mode = 2

[node name="WidthContainer" type="HBoxContainer" parent="VBoxContainer/PercentageContainer"]
layout_mode = 2

[node name="WidthLabel" type="Label" parent="VBoxContainer/PercentageContainer/WidthContainer"]
custom_minimum_size = Vector2(90, 0)
layout_mode = 2
text = "Width:"

[node name="WidthValuePerc" type="SpinBox" parent="VBoxContainer/PercentageContainer/WidthContainer"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
step = 0.01
value = 100.0
suffix = "%"

[node name="HeightContainer" type="HBoxContainer" parent="VBoxContainer/PercentageContainer"]
layout_mode = 2

[node name="Height" type="Label" parent="VBoxContainer/PercentageContainer/HeightContainer"]
custom_minimum_size = Vector2(90, 0)
layout_mode = 2
text = "Height:"

[node name="HeightValuePerc" type="SpinBox" parent="VBoxContainer/PercentageContainer/HeightContainer"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 16384.0
step = 0.01
value = 100.0
suffix = "%"

[node name="HSeparator3" type="HSeparator" parent="VBoxContainer"]
layout_mode = 2

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

[node name="InterpolationLabel" type="Label" parent="VBoxContainer/InterpolationContainer"]
custom_minimum_size = Vector2(90, 0)
layout_mode = 2
text = "Interpolation:"

[node name="InterpolationType" type="OptionButton" parent="VBoxContainer/InterpolationContainer"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2

[connection signal="about_to_popup" from="." to="." method="_on_ScaleImage_about_to_show"]
[connection signal="confirmed" from="." to="." method="_on_ScaleImage_confirmed"]
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="value_changed" from="VBoxContainer/SizeContainer/VBoxContainer/WidthContainer/WidthValue" to="." method="_on_WidthValue_value_changed"]
[connection signal="value_changed" from="VBoxContainer/SizeContainer/VBoxContainer/HeightContainer/HeightValue" to="." method="_on_HeightValue_value_changed"]
[connection signal="toggled" from="VBoxContainer/SizeContainer/TextureRect/AspectRatioButton" to="." method="_on_AspectRatioButton_toggled"]
[connection signal="value_changed" from="VBoxContainer/PercentageContainer/WidthContainer/WidthValuePerc" to="." method="_on_WidthValuePerc_value_changed"]
[connection signal="value_changed" from="VBoxContainer/PercentageContainer/HeightContainer/HeightValuePerc" to="." method="_on_HeightValuePerc_value_changed"]
