1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-20 12:33:14 +00:00

Add a checkbox in Preferences for quit confirmation

This has no effect if the project has unsaved changes.
This commit is contained in:
Manolis Papadeas 2022-01-05 02:34:45 +02:00
parent 0fa6879bdf
commit c242cd546d
5 changed files with 34 additions and 6 deletions

View file

@ -1691,6 +1691,9 @@ msgstr ""
msgid "Opens last opened project on startup"
msgstr ""
msgid "Quit confirmation"
msgstr ""
msgid "Enable autosave"
msgstr ""

View file

@ -34,6 +34,7 @@ var default_clear_color := Color.gray
# Preferences
var pressure_sensitivity_mode = PressureSensitivity.NONE
var open_last_project := false
var quit_confirmation := false
var smooth_zoom := true
var shrink := 1.0

View file

@ -440,7 +440,10 @@ func _can_draw_true() -> void:
func show_quit_dialog() -> void:
if !quit_dialog.visible:
if !Global.current_project.has_changed:
quit_dialog.call_deferred("popup_centered")
if Global.quit_confirmation:
quit_dialog.call_deferred("popup_centered")
else:
_on_QuitDialog_confirmed()
else:
Global.quit_and_save_dialog.call_deferred("popup_centered")

View file

@ -8,6 +8,12 @@ var preferences = [
"pressed",
Global.open_last_project
],
[
"quit_confirmation",
"Startup/StartupContainer/QuitConfirmation",
"pressed",
Global.quit_confirmation
],
["shrink", "Interface/ShrinkContainer/ShrinkHSlider", "value", Global.shrink],
["dim_on_popup", "Interface/DimPopup/CheckBox", "pressed", Global.dim_on_popup],
[

View file

@ -51,18 +51,19 @@ size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
margin_right = 498.0
margin_bottom = 24.0
margin_bottom = 52.0
size_flags_horizontal = 3
[node name="Startup" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
margin_right = 498.0
margin_bottom = 24.0
margin_bottom = 52.0
[node name="StartupContainer" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup"]
[node name="StartupContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup"]
margin_right = 498.0
margin_bottom = 24.0
margin_bottom = 52.0
columns = 3
[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
[node name="OpenLastProjectLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
margin_top = 5.0
margin_right = 180.0
margin_bottom = 19.0
@ -76,6 +77,20 @@ hint_tooltip = "Opens last opened project on startup"
mouse_default_cursor_shape = 2
text = "On"
[node name="QuitConfirmationLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
margin_left = 235.0
margin_top = 5.0
margin_right = 348.0
margin_bottom = 19.0
text = "Quit confirmation"
[node name="QuitConfirmation" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup/StartupContainer"]
margin_top = 28.0
margin_right = 180.0
margin_bottom = 52.0
mouse_default_cursor_shape = 2
text = "On"
[node name="PressureSentivity" type="HBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Startup"]
visible = false
margin_top = 28.0