mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-20 12:33:14 +00:00
Made HSVDialog a ConfirmationDialog node
To be consistent with the rest of the image effect dialogs
This commit is contained in:
parent
a65fc0e00c
commit
b73937fd0c
2 changed files with 29 additions and 56 deletions
|
@ -1,4 +1,4 @@
|
|||
extends WindowDialog
|
||||
extends ConfirmationDialog
|
||||
|
||||
|
||||
enum {CEL, FRAME, ALL_FRAMES, ALL_PROJECTS}
|
||||
|
@ -34,12 +34,7 @@ func _on_HSVDialog_about_to_show() -> void:
|
|||
update_preview()
|
||||
|
||||
|
||||
func _on_Cancel_pressed() -> void:
|
||||
visible = false
|
||||
reset()
|
||||
|
||||
|
||||
func _on_Apply_pressed() -> void:
|
||||
func _on_HSVDialog_confirmed() -> void:
|
||||
if affect == CEL:
|
||||
Global.canvas.handle_undo("Draw")
|
||||
DrawingAlgos.adjust_hsv(current_cel, hue_slider.value, sat_slider.value, val_slider.value, pixels)
|
||||
|
@ -74,7 +69,6 @@ func _on_Apply_pressed() -> void:
|
|||
DrawingAlgos.adjust_hsv(cel.image, hue_slider.value, sat_slider.value, val_slider.value, _pixels)
|
||||
Global.canvas.handle_redo("Draw", project, -1, -1)
|
||||
reset()
|
||||
visible = false
|
||||
|
||||
|
||||
func reset() -> void:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
[ext_resource path="res://src/UI/Dialogs/ImageEffects/HSVDialog.gd" type="Script" id=1]
|
||||
|
||||
[node name="HSVDialog" type="WindowDialog"]
|
||||
[node name="HSVDialog" type="ConfirmationDialog"]
|
||||
margin_left = 1.0
|
||||
margin_top = -1.0
|
||||
margin_right = 464.0
|
||||
|
@ -14,6 +14,10 @@ script = ExtResource( 1 )
|
|||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
margin_top = 8.0
|
||||
margin_right = -8.0
|
||||
margin_bottom = -36.0
|
||||
custom_constants/margin_right = 5
|
||||
custom_constants/margin_top = 5
|
||||
custom_constants/margin_left = 5
|
||||
|
@ -25,65 +29,65 @@ __meta__ = {
|
|||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_left = 5.0
|
||||
margin_top = 5.0
|
||||
margin_right = 458.0
|
||||
margin_bottom = 314.0
|
||||
margin_right = 442.0
|
||||
margin_bottom = 270.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer"]
|
||||
margin_right = 453.0
|
||||
margin_bottom = 169.0
|
||||
margin_right = 437.0
|
||||
margin_bottom = 149.0
|
||||
size_flags_vertical = 3
|
||||
expand = true
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = 173.0
|
||||
margin_right = 453.0
|
||||
margin_bottom = 257.0
|
||||
margin_top = 153.0
|
||||
margin_right = 437.0
|
||||
margin_bottom = 237.0
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Names" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
margin_right = 82.0
|
||||
margin_right = 79.0
|
||||
margin_bottom = 84.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.9
|
||||
custom_constants/separation = 8
|
||||
|
||||
[node name="Hue" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/Names"]
|
||||
margin_right = 82.0
|
||||
margin_right = 79.0
|
||||
margin_bottom = 14.0
|
||||
text = "Hue"
|
||||
align = 2
|
||||
|
||||
[node name="Saturation" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/Names"]
|
||||
margin_top = 22.0
|
||||
margin_right = 82.0
|
||||
margin_right = 79.0
|
||||
margin_bottom = 36.0
|
||||
text = "Saturation"
|
||||
align = 2
|
||||
|
||||
[node name="Value" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/Names"]
|
||||
margin_top = 44.0
|
||||
margin_right = 82.0
|
||||
margin_right = 79.0
|
||||
margin_bottom = 58.0
|
||||
text = "Value"
|
||||
align = 2
|
||||
|
||||
[node name="Sliders" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 92.0
|
||||
margin_right = 368.0
|
||||
margin_left = 89.0
|
||||
margin_right = 352.0
|
||||
margin_bottom = 84.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 3.0
|
||||
custom_constants/separation = 7
|
||||
|
||||
[node name="Hue" type="HSlider" parent="MarginContainer/VBoxContainer/HBoxContainer/Sliders"]
|
||||
margin_right = 276.0
|
||||
margin_right = 263.0
|
||||
margin_bottom = 16.0
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = -180.0
|
||||
|
@ -91,21 +95,21 @@ max_value = 180.0
|
|||
|
||||
[node name="Saturation" type="HSlider" parent="MarginContainer/VBoxContainer/HBoxContainer/Sliders"]
|
||||
margin_top = 23.0
|
||||
margin_right = 276.0
|
||||
margin_right = 263.0
|
||||
margin_bottom = 39.0
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = -100.0
|
||||
|
||||
[node name="Value" type="HSlider" parent="MarginContainer/VBoxContainer/HBoxContainer/Sliders"]
|
||||
margin_top = 46.0
|
||||
margin_right = 276.0
|
||||
margin_right = 263.0
|
||||
margin_bottom = 62.0
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = -100.0
|
||||
|
||||
[node name="TextBoxes" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
margin_left = 378.0
|
||||
margin_right = 452.0
|
||||
margin_left = 362.0
|
||||
margin_right = 436.0
|
||||
margin_bottom = 84.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.0
|
||||
|
@ -133,9 +137,9 @@ mouse_default_cursor_shape = 1
|
|||
min_value = -100.0
|
||||
|
||||
[node name="AffectHBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = 261.0
|
||||
margin_right = 453.0
|
||||
margin_bottom = 285.0
|
||||
margin_top = 241.0
|
||||
margin_right = 437.0
|
||||
margin_bottom = 265.0
|
||||
|
||||
[node name="SelectionCheckBox" type="CheckBox" parent="MarginContainer/VBoxContainer/AffectHBoxContainer"]
|
||||
margin_right = 160.0
|
||||
|
@ -152,31 +156,8 @@ mouse_default_cursor_shape = 2
|
|||
text = "Current cel"
|
||||
items = [ "Current cel", null, false, 0, null, "Current frame", null, false, 1, null, "All frames", null, false, 2, null, "All projects", null, false, 3, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = 289.0
|
||||
margin_right = 453.0
|
||||
margin_bottom = 309.0
|
||||
custom_constants/separation = 16
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Apply" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
margin_right = 218.0
|
||||
margin_bottom = 20.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Apply"
|
||||
|
||||
[node name="Cancel" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer2"]
|
||||
margin_left = 234.0
|
||||
margin_right = 453.0
|
||||
margin_bottom = 20.0
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Cancel"
|
||||
[connection signal="about_to_show" from="." to="." method="_on_HSVDialog_about_to_show"]
|
||||
[connection signal="confirmed" from="." to="." method="_on_HSVDialog_confirmed"]
|
||||
[connection signal="popup_hide" from="." to="." method="_on_HSVDialog_popup_hide"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/Sliders/Hue" to="." method="_on_Hue_value_changed"]
|
||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/Sliders/Saturation" to="." method="_on_Saturation_value_changed"]
|
||||
|
@ -186,5 +167,3 @@ text = "Cancel"
|
|||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/TextBoxes/Value" to="." method="_on_Value_value_changed"]
|
||||
[connection signal="toggled" from="MarginContainer/VBoxContainer/AffectHBoxContainer/SelectionCheckBox" to="." method="_on_SelectionCheckBox_toggled"]
|
||||
[connection signal="item_selected" from="MarginContainer/VBoxContainer/AffectHBoxContainer/AffectOptionButton" to="." method="_on_AffectOptionButton_item_selected"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/Apply" to="." method="_on_Apply_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/Cancel" to="." method="_on_Cancel_pressed"]
|
||||
|
|
Loading…
Add table
Reference in a new issue