Skip to content

Commit

Permalink
Disable wrap mouse option if not supported (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiisu-Master authored Jan 9, 2024
1 parent 0f8b7e0 commit 361a054
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/SVG.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var root_tag := TagSVG.new()
var saved_text := ""
var UR := UndoRedo.new()

signal parsing_finished(error_id: StringName)
signal parsing_finished(error_id: StringName)

func _ready() -> void:
root_tag.changed_unknown.connect(update_text.bind(false))
Expand All @@ -28,6 +28,8 @@ func _ready() -> void:
cmdline_args.size() >= 1:
load_cmdl = true

await get_tree().get_root().ready # Await tree ready to be able to add error dialogs.

if (apply_svg_from_path(cmdline_args[0]) if load_cmdl else -1) == OK:
pass
elif not GlobalSettings.save_data.svg_text.is_empty():
Expand Down
8 changes: 7 additions & 1 deletion src/ui_parts/settings_menu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ const plus_icon = preload("res://visual/icons/Plus.svg")

@onready var lang_button: Button = %Language
@onready var palette_container: VBoxContainer = %PaletteContainer

@onready var wrap_mouse: CheckBox = $"VBoxContainer/TabContainer/#input_tab/VBoxContainer/WrapMouse"

func _ready() -> void:

# Disable wrap mouse setting if unsupported.
if not DisplayServer.has_feature(DisplayServer.FEATURE_MOUSE_WARP):
wrap_mouse.set_pressed_no_signal(false)
wrap_mouse.disabled = true

update_language_button()
rebuild_color_palettes()

Expand Down
2 changes: 1 addition & 1 deletion src/ui_parts/settings_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ext_resource type="Script" path="res://src/ui_parts/settings_menu.gd" id="1_1gf4m"]
[ext_resource type="Texture2D" uid="uid://c528knojuxbw6" path="res://visual/icons/Languages.svg" id="2_ndyp7"]
[ext_resource type="Script" path="res://src/ui_elements/BetterTabContainer.gd" id="3_vslgx"]
[ext_resource type="PackedScene" path="res://src/ui_elements/setting_check_box.tscn" id="4_2qeh2"]
[ext_resource type="PackedScene" uid="uid://chgcy63ldo7x5" path="res://src/ui_elements/setting_check_box.tscn" id="4_2qeh2"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hto7q"]
content_margin_left = 8.0
Expand Down

0 comments on commit 361a054

Please sign in to comment.