From e00f7518c34e35bc9d57d0790149c39e957f049f Mon Sep 17 00:00:00 2001 From: Premo <38495887+Dansla116@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:17:18 -0400 Subject: [PATCH] Added option to set idle time before cursor is hidden Fixes #4930 In SettingsWindow.cs and SettingsWindow.glade: Replaced Always/On Idle/Never radio buttons with a dropdown (combo box). When selecting "On Idle", a "Seconds" label and numeric text box (spinner) appear. The spinner is limited 1-10. In ConfigurationFileFormat.cs and ConfigurationState.cs, and SettingsViewModel.cs: Load the saved value, or default 5 seconds if no value exists. Save the custom set value to the config file. In SettingsViewModel.cs: Catch when the idle time setting is changed while a game is running, and change the value live. --- src/Ryujinx/UI/ViewModels/SettingsViewModel.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs index 6074a5fdb..d45cec9ee 100644 --- a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs @@ -132,6 +132,7 @@ namespace Ryujinx.Ava.UI.ViewModels public bool CheckUpdatesOnStart { get; set; } public bool ShowConfirmExit { get; set; } public int HideCursor { get; set; } + public int HideCursorIdleTime { get; set; } public bool EnableDockedMode { get; set; } public bool EnableKeyboard { get; set; } public bool EnableMouse { get; set; } @@ -391,6 +392,7 @@ namespace Ryujinx.Ava.UI.ViewModels CheckUpdatesOnStart = config.CheckUpdatesOnStart; ShowConfirmExit = config.ShowConfirmExit; HideCursor = (int)config.HideCursor.Value; + HideCursorIdleTime = (int)config.HideCursorIdleTime.Value; GameDirectories.Clear(); GameDirectories.AddRange(config.UI.GameDirs.Value); @@ -475,6 +477,7 @@ namespace Ryujinx.Ava.UI.ViewModels config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart; config.ShowConfirmExit.Value = ShowConfirmExit; config.HideCursor.Value = (HideCursorMode)HideCursor; + config.HideCursorIdleTime.Value = HideCursorIdleTime; if (_directoryChanged) {