diff --git a/Translations/Translations.pot b/Translations/Translations.pot index e383b6899..b6dbe59e3 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -443,6 +443,9 @@ msgstr "" msgid "Performance" msgstr "" +msgid "Cursors" +msgstr "" + msgid "Indicators" msgstr "" @@ -929,6 +932,12 @@ msgstr "" msgid "Displays an icon of the selected right tool next to the cursor on the canvas" msgstr "" +msgid "Use native mouse cursors" +msgstr "" + +msgid "Use cross cursor for the canvas" +msgstr "" + msgid "Guides" msgstr "" diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index bc47e94fa..f09d4a7e2 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -80,6 +80,8 @@ var show_left_tool_icon := true var show_right_tool_icon := true var left_square_indicator_visible := true var right_square_indicator_visible := false +var native_cursors := false +var cross_cursor := true # View menu options var mirror_view := false diff --git a/src/Main.gd b/src/Main.gd index f3e23ca77..789859466 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -19,7 +19,8 @@ func _ready() -> void: if OS.get_name() == "OSX": _use_osx_shortcuts() - Input.set_custom_mouse_cursor(cursor_image, Input.CURSOR_CROSS, Vector2(15, 15)) + if !Global.native_cursors: + Input.set_custom_mouse_cursor(cursor_image, Input.CURSOR_CROSS, Vector2(15, 15)) Global.window_title = tr("untitled") + " - Pixelorama " + Global.current_version Global.current_project.layers[0].name = tr("Layer") + " 0" diff --git a/src/Preferences/PreferencesDialog.gd b/src/Preferences/PreferencesDialog.gd index 87d91fb20..0ec9c2b1b 100644 --- a/src/Preferences/PreferencesDialog.gd +++ b/src/Preferences/PreferencesDialog.gd @@ -42,28 +42,40 @@ var preferences = [ ], [ "show_left_tool_icon", - "Indicators/IndicatorsContainer/LeftToolIconCheckbox", + "Cursors/CursorsContainer/LeftToolIconCheckbox", "pressed", Global.show_left_tool_icon ], [ "show_right_tool_icon", - "Indicators/IndicatorsContainer/RightToolIconCheckbox", + "Cursors/CursorsContainer/RightToolIconCheckbox", "pressed", Global.show_right_tool_icon ], [ "left_square_indicator_visible", - "Indicators/IndicatorsContainer/LeftIndicatorCheckbox", + "Cursors/CursorsContainer/LeftIndicatorCheckbox", "pressed", Global.left_square_indicator_visible ], [ "right_square_indicator_visible", - "Indicators/IndicatorsContainer/RightIndicatorCheckbox", + "Cursors/CursorsContainer/RightIndicatorCheckbox", "pressed", Global.right_square_indicator_visible ], + [ + "native_cursors", + "Cursors/CursorsContainer/NativeCursorsCheckbox", + "pressed", + Global.native_cursors + ], + [ + "cross_cursor", + "Cursors/CursorsContainer/CrossCursorCheckbox", + "pressed", + Global.cross_cursor + ], [ "autosave_interval", "Backup/AutosaveContainer/AutosaveInterval", @@ -358,6 +370,20 @@ func preference_update(prop: String) -> void: if prop == "tool_button_size": Tools.set_button_size(Global.tool_button_size) + if prop == "native_cursors": + var image + if Global.native_cursors: + image = null + else: + image = Global.control.cursor_image + Input.set_custom_mouse_cursor(image, Input.CURSOR_CROSS, Vector2(15, 15)) + + if prop == "cross_cursor": + if Global.cross_cursor: + Global.main_viewport.mouse_default_cursor_shape = Control.CURSOR_CROSS + else: + Global.main_viewport.mouse_default_cursor_shape = Control.CURSOR_ARROW + Global.config_cache.save("user://cache.ini") @@ -386,7 +412,7 @@ func add_tabs(changed_language := false) -> void: list.add_item(" " + tr("Shortcuts")) list.add_item(" " + tr("Backup")) list.add_item(" " + tr("Performance")) - list.add_item(" " + tr("Indicators")) + list.add_item(" " + tr("Cursors")) list.select(1 if changed_language else selected_item) autosave_interval.suffix = tr("minute(s)") @@ -409,7 +435,7 @@ func _on_List_item_selected(index: int) -> void: "Shortcuts", "Backup", "Performance", - "Indicators" + "Cursors" ] if OS.get_name() == "HTML5": content_list.erase("Startup") diff --git a/src/Preferences/PreferencesDialog.tscn b/src/Preferences/PreferencesDialog.tscn index 8880c1865..df2cb80e1 100644 --- a/src/Preferences/PreferencesDialog.tscn +++ b/src/Preferences/PreferencesDialog.tscn @@ -1443,29 +1443,28 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Indicators" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"] +[node name="Cursors" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"] visible = false -margin_top = 54.0 -margin_right = 498.0 -margin_bottom = 180.0 +margin_top = 56.0 +margin_right = 525.0 +margin_bottom = 164.0 -[node name="IndicatorsContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators"] -margin_top = 18.0 -margin_right = 498.0 -margin_bottom = 126.0 +[node name="CursorsContainer" type="GridContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors"] +margin_right = 525.0 +margin_bottom = 108.0 custom_constants/vseparation = 4 custom_constants/hseparation = 4 columns = 3 -[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] +[node name="Label" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] margin_top = 5.0 -margin_right = 127.0 +margin_right = 126.0 margin_bottom = 19.0 text = "Left pixel indicator" -[node name="LeftIndicatorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_left = 131.0 -margin_right = 498.0 +[node name="LeftIndicatorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 130.0 +margin_right = 354.0 margin_bottom = 24.0 hint_tooltip = "Show left mouse pixel indicator or brush on the canvas when drawing" mouse_default_cursor_shape = 2 @@ -1473,56 +1472,87 @@ size_flags_horizontal = 3 pressed = true text = "On" -[node name="Label2" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_top = 33.0 -margin_right = 127.0 -margin_bottom = 47.0 +[node name="Label2" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 358.0 +margin_top = 5.0 +margin_right = 525.0 +margin_bottom = 19.0 text = "Right pixel indicator" -[node name="RightIndicatorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_left = 131.0 +[node name="RightIndicatorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] margin_top = 28.0 -margin_right = 498.0 +margin_right = 126.0 margin_bottom = 52.0 hint_tooltip = "Show right mouse pixel indicator or brush on the canvas when drawing" mouse_default_cursor_shape = 2 size_flags_horizontal = 3 text = "On" -[node name="Label3" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_top = 61.0 -margin_right = 127.0 -margin_bottom = 75.0 +[node name="Label3" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 130.0 +margin_top = 33.0 +margin_right = 354.0 +margin_bottom = 47.0 text = "Show left tool icon" -[node name="LeftToolIconCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_left = 131.0 -margin_top = 56.0 -margin_right = 498.0 -margin_bottom = 80.0 +[node name="LeftToolIconCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 358.0 +margin_top = 28.0 +margin_right = 525.0 +margin_bottom = 52.0 hint_tooltip = "Displays an icon of the selected left tool next to the cursor on the canvas" mouse_default_cursor_shape = 2 size_flags_horizontal = 3 pressed = true text = "On" -[node name="Label4" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_top = 89.0 -margin_right = 127.0 -margin_bottom = 103.0 +[node name="Label4" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_top = 61.0 +margin_right = 126.0 +margin_bottom = 75.0 text = "Show right tool icon" -[node name="RightToolIconCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Indicators/IndicatorsContainer"] -margin_left = 131.0 -margin_top = 84.0 -margin_right = 498.0 -margin_bottom = 108.0 +[node name="RightToolIconCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 130.0 +margin_top = 56.0 +margin_right = 354.0 +margin_bottom = 80.0 hint_tooltip = "Displays an icon of the selected right tool next to the cursor on the canvas" mouse_default_cursor_shape = 2 size_flags_horizontal = 3 pressed = true text = "On" +[node name="Label5" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 358.0 +margin_top = 61.0 +margin_right = 525.0 +margin_bottom = 75.0 +text = "Use native mouse cursors" + +[node name="NativeCursorsCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_top = 84.0 +margin_right = 126.0 +margin_bottom = 108.0 +mouse_default_cursor_shape = 2 +text = "On" + +[node name="Label6" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 130.0 +margin_top = 89.0 +margin_right = 354.0 +margin_bottom = 103.0 +text = "Use cross cursor for the canvas" + +[node name="CrossCursorCheckbox" type="CheckBox" parent="HSplitContainer/ScrollContainer/VBoxContainer/Cursors/CursorsContainer"] +margin_left = 358.0 +margin_top = 84.0 +margin_right = 525.0 +margin_bottom = 108.0 +mouse_default_cursor_shape = 2 +pressed = true +text = "On" + [node name="Popups" type="Node" parent="."] [node name="ShortcutSelector" type="ConfirmationDialog" parent="Popups"]