diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 612280760..fa4958e6d 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -923,6 +923,10 @@ msgstr "" msgid "Dim interface on dialog popup" msgstr "" +#. Found in the preferences, under the interface section. If enabled, the notification labels appear in the canvas when performing an action, such as when undoing/redoing. +msgid "Show notification labels" +msgstr "" + #. Found in the preferences, under the interface section. When this setting is enabled, the native file dialogs of the operating system are being used, instead of Pixelorama's custom ones. msgid "Use native file dialogs" msgstr "" diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 1ccc5397e..ad76517bd 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -232,6 +232,8 @@ var theme_font_index := 1: var font_size := 16 ## Found in Preferences. If [code]true[/code], the interface dims on popups. var dim_on_popup := true +## Found in Preferences. If [code]true[/code], notification labels appear. +var show_notification_label := true ## Found in Preferences. If [code]true[/code], the native file dialogs of the ## operating system are being used, instead of Godot's FileDialog node. var use_native_file_dialogs := false: @@ -947,6 +949,8 @@ func _initialize_keychain() -> void: ## Generates an animated notification label showing [param text]. func notification_label(text: String) -> void: + if not show_notification_label: + return var notif := NotificationLabel.new() notif.text = tr(text) notif.position = main_viewport.global_position diff --git a/src/Preferences/PreferencesDialog.gd b/src/Preferences/PreferencesDialog.gd index e3fa87af5..3a12a9fd6 100644 --- a/src/Preferences/PreferencesDialog.gd +++ b/src/Preferences/PreferencesDialog.gd @@ -14,6 +14,12 @@ var preferences: Array[Preference] = [ Preference.new( "dim_on_popup", "Interface/InterfaceOptions/DimCheckBox", "button_pressed", true ), + Preference.new( + "show_notification_label", + "Interface/InterfaceOptions/ShowNotificationCheckBox", + "button_pressed", + true + ), Preference.new( "use_native_file_dialogs", "Interface/InterfaceOptions/NativeFileDialogs", diff --git a/src/Preferences/PreferencesDialog.tscn b/src/Preferences/PreferencesDialog.tscn index 5327307fa..8d6872ffb 100644 --- a/src/Preferences/PreferencesDialog.tscn +++ b/src/Preferences/PreferencesDialog.tscn @@ -228,6 +228,18 @@ mouse_default_cursor_shape = 2 button_pressed = true text = "On" +[node name="ShowNotificationLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/InterfaceOptions"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Show notification labels" + +[node name="ShowNotificationCheckBox" type="CheckBox" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/InterfaceOptions"] +layout_mode = 2 +size_flags_horizontal = 3 +mouse_default_cursor_shape = 2 +button_pressed = true +text = "On" + [node name="NativeFileDialogsLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Interface/InterfaceOptions" groups=["DesktopOnly", "NoSandbox"]] layout_mode = 2 size_flags_horizontal = 3