diff options
| author | pineappleEA <67879877+pineappleEA@users.noreply.github.com> | 2021-02-15 23:48:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-15 22:48:21 +0100 |
| commit | 6f1d9648016c9442f6dcdac257f28c1a7a19aca0 (patch) | |
| tree | 2ce859f6632afcdcada5c7a67d3b31e32fc959ad /Ryujinx.Common/Configuration/ConfigurationState.cs | |
| parent | 80ed8596c165127fb52026c697a9b6b515dabbd4 (diff) | |
Hide Cursor On Idle (#1993)
* Implement "Hide Cursor On Idle" option
Adds a general option to autohide the cursor after 8s have elapsed.
* Fix cursor not hiding on Windows and dispose it
* Don't dispose cursor, fix var names
* Abide by the GNOME documentation
* Fix nits
* Disabled by default, make it so it doesn't utilize any timer
* Remove *NIX time and extra lines
* Don't calculate if option is disabled
* Move if case
* Fix alignment
Diffstat (limited to 'Ryujinx.Common/Configuration/ConfigurationState.cs')
| -rw-r--r-- | Ryujinx.Common/Configuration/ConfigurationState.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs index 61cc8f89..d51ee9ef 100644 --- a/Ryujinx.Common/Configuration/ConfigurationState.cs +++ b/Ryujinx.Common/Configuration/ConfigurationState.cs @@ -365,6 +365,11 @@ namespace Ryujinx.Configuration /// </summary> public ReactiveObject<bool> ShowConfirmExit { get; private set; } + /// <summary> + /// Hide Cursor on Idle + /// </summary> + public ReactiveObject<bool> HideCursorOnIdle { get; private set; } + private ConfigurationState() { Ui = new UiSection(); @@ -375,6 +380,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration = new ReactiveObject<bool>(); CheckUpdatesOnStart = new ReactiveObject<bool>(); ShowConfirmExit = new ReactiveObject<bool>(); + HideCursorOnIdle = new ReactiveObject<bool>(); } public ConfigurationFileFormat ToFileFormat() @@ -420,6 +426,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration = EnableDiscordIntegration, CheckUpdatesOnStart = CheckUpdatesOnStart, ShowConfirmExit = ShowConfirmExit, + HideCursorOnIdle = HideCursorOnIdle, EnableVsync = Graphics.EnableVsync, EnableShaderCache = Graphics.EnableShaderCache, EnablePtc = System.EnablePtc, @@ -483,6 +490,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration.Value = true; CheckUpdatesOnStart.Value = true; ShowConfirmExit.Value = true; + HideCursorOnIdle.Value = false; Graphics.EnableVsync.Value = true; Graphics.EnableShaderCache.Value = true; System.EnablePtc.Value = true; @@ -787,6 +795,15 @@ namespace Ryujinx.Configuration configurationFileUpdated = true; } + if (configurationFileFormat.Version < 22) + { + Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 22."); + + configurationFileFormat.HideCursorOnIdle = false; + + configurationFileUpdated = true; + } + List<InputConfig> inputConfig = new List<InputConfig>(); inputConfig.AddRange(configurationFileFormat.ControllerConfig); inputConfig.AddRange(configurationFileFormat.KeyboardConfig); @@ -814,6 +831,7 @@ namespace Ryujinx.Configuration EnableDiscordIntegration.Value = configurationFileFormat.EnableDiscordIntegration; CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart; ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit; + HideCursorOnIdle.Value = configurationFileFormat.HideCursorOnIdle; Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync; Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache; System.EnablePtc.Value = configurationFileFormat.EnablePtc; |
