From 5f290ae34387ba2ff813a2ffc01e0a092018fe7b Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Thu, 30 Mar 2023 18:20:55 +0300 Subject: [PATCH] Change resize SpinBox to ValueSlider in ExportDialog --- src/UI/Dialogs/ExportDialog.gd | 2 +- src/UI/Dialogs/ExportDialog.tscn | 54 ++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/UI/Dialogs/ExportDialog.gd b/src/UI/Dialogs/ExportDialog.gd index 8fb91ce6b..63eca5c5f 100644 --- a/src/UI/Dialogs/ExportDialog.gd +++ b/src/UI/Dialogs/ExportDialog.gd @@ -16,7 +16,7 @@ onready var spritesheet_lines_count_label: Label = $"%LinesCountLabel" onready var frames_option_button: OptionButton = $"%Frames" onready var layers_option_button: OptionButton = $"%Layers" -onready var options_resize: SpinBox = $"%Resize" +onready var options_resize: ValueSlider = $"%Resize" onready var dimension_label: Label = $"%DimensionLabel" onready var path_line_edit: LineEdit = $"%PathLineEdit" diff --git a/src/UI/Dialogs/ExportDialog.tscn b/src/UI/Dialogs/ExportDialog.tscn index 5298f3585..458be3a50 100644 --- a/src/UI/Dialogs/ExportDialog.tscn +++ b/src/UI/Dialogs/ExportDialog.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://src/UI/Dialogs/ExportDialog.gd" type="Script" id=1] [ext_resource path="res://src/UI/Nodes/TransparentChecker.tscn" type="PackedScene" id=2] [ext_resource path="res://src/UI/Nodes/CollapsibleContainer.gd" type="Script" id=3] +[ext_resource path="res://src/UI/Nodes/ValueSlider.gd" type="Script" id=4] [node name="ExportDialog" type="ConfirmationDialog"] margin_right = 532.0 @@ -44,7 +45,7 @@ size_flags_vertical = 3 [node name="PreviewPanel" type="Panel" parent="VBoxContainer/VSplitContainer"] margin_right = 516.0 -margin_bottom = 158.0 +margin_bottom = 168.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -64,20 +65,20 @@ size_flags_vertical = 3 [node name="Previews" type="GridContainer" parent="VBoxContainer/VSplitContainer/PreviewPanel/PreviewScroll"] unique_name_in_owner = true margin_right = 516.0 -margin_bottom = 158.0 +margin_bottom = 168.0 size_flags_horizontal = 3 size_flags_vertical = 3 columns = 3 [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/VSplitContainer"] -margin_top = 170.0 +margin_top = 180.0 margin_right = 516.0 margin_bottom = 432.0 size_flags_vertical = 3 [node name="GridContainer" type="GridContainer" parent="VBoxContainer/VSplitContainer/VBoxContainer"] margin_right = 516.0 -margin_bottom = 166.0 +margin_bottom = 156.0 columns = 2 [node name="OrientationLabel" type="Label" parent="VBoxContainer/VSplitContainer/VBoxContainer/GridContainer" groups=["ExportSpritesheetOptions"]] @@ -177,51 +178,58 @@ __meta__ = { } [node name="ResizeLabel" type="Label" parent="VBoxContainer/VSplitContainer/VBoxContainer/GridContainer"] -margin_top = 129.0 +margin_top = 124.0 margin_right = 256.0 -margin_bottom = 143.0 +margin_bottom = 138.0 rect_min_size = Vector2( 30, 0 ) text = "Resize:" -[node name="Resize" type="SpinBox" parent="VBoxContainer/VSplitContainer/VBoxContainer/GridContainer"] +[node name="Resize" type="TextureProgress" parent="VBoxContainer/VSplitContainer/VBoxContainer/GridContainer"] unique_name_in_owner = true margin_left = 260.0 margin_top = 124.0 margin_right = 516.0 -margin_bottom = 148.0 +margin_bottom = 138.0 mouse_default_cursor_shape = 2 -size_flags_horizontal = 3 +theme_type_variation = "ValueSlider" min_value = 50.0 max_value = 1000.0 -step = 100.0 +step = 50.0 value = 100.0 +nine_patch_stretch = true +stretch_margin_left = 3 +stretch_margin_top = 3 +stretch_margin_right = 3 +stretch_margin_bottom = 3 +script = ExtResource( 4 ) suffix = "%" +snap_step = 100.0 [node name="DimensionLabelText" type="Label" parent="VBoxContainer/VSplitContainer/VBoxContainer/GridContainer"] -margin_top = 152.0 +margin_top = 142.0 margin_right = 256.0 -margin_bottom = 166.0 +margin_bottom = 156.0 size_flags_horizontal = 3 text = "Export dimensions:" [node name="DimensionLabel" type="Label" parent="VBoxContainer/VSplitContainer/VBoxContainer/GridContainer"] unique_name_in_owner = true margin_left = 260.0 -margin_top = 152.0 +margin_top = 142.0 margin_right = 516.0 -margin_bottom = 166.0 +margin_bottom = 156.0 size_flags_horizontal = 3 text = "64×64" [node name="HSeparator2" type="HSeparator" parent="VBoxContainer/VSplitContainer/VBoxContainer"] -margin_top = 170.0 +margin_top = 160.0 margin_right = 516.0 -margin_bottom = 174.0 +margin_bottom = 164.0 [node name="FilePath" type="GridContainer" parent="VBoxContainer/VSplitContainer/VBoxContainer"] -margin_top = 178.0 +margin_top = 168.0 margin_right = 516.0 -margin_bottom = 230.0 +margin_bottom = 220.0 columns = 3 [node name="Label" type="Label" parent="VBoxContainer/VSplitContainer/VBoxContainer/FilePath" groups=["NotHTML5"]] @@ -277,14 +285,14 @@ rect_min_size = Vector2( 130, 0 ) mouse_default_cursor_shape = 2 [node name="HSeparator3" type="HSeparator" parent="VBoxContainer/VSplitContainer/VBoxContainer"] -margin_top = 234.0 +margin_top = 224.0 margin_right = 516.0 -margin_bottom = 238.0 +margin_bottom = 228.0 [node name="CollapsibleContainer" type="VBoxContainer" parent="VBoxContainer/VSplitContainer/VBoxContainer"] -margin_top = 242.0 +margin_top = 232.0 margin_right = 516.0 -margin_bottom = 262.0 +margin_bottom = 252.0 theme_type_variation = "CollapsibleContainer" script = ExtResource( 3 ) text = "Advanced options"