Added a config field [CursorHideIdleTime], then edited the related ui in SettingsUIView. To: [Feature Request] Allow to set a custom value for "Hide Cursor On Idle". #4930
This commit is contained in:
parent
2505a1abcd
commit
a0b416d87d
6 changed files with 34 additions and 2 deletions
|
@ -167,6 +167,11 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HideCursorMode HideCursor { get; set; }
|
public HideCursorMode HideCursor { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A time limit when the cursor will hide, if the [HideCursorMode] is [On Idle].
|
||||||
|
/// </summary>
|
||||||
|
public int CursorHideIdleTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables or disables Vertical Sync
|
/// Enables or disables Vertical Sync
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -631,6 +631,11 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReactiveObject<HideCursorMode> HideCursor { get; private set; }
|
public ReactiveObject<HideCursorMode> HideCursor { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time Limit for Hide Cursor on Idle
|
||||||
|
/// </summary>
|
||||||
|
public ReactiveObject<int> CursorHideIdleTime { get; private set; }
|
||||||
|
|
||||||
private ConfigurationState()
|
private ConfigurationState()
|
||||||
{
|
{
|
||||||
UI = new UISection();
|
UI = new UISection();
|
||||||
|
@ -643,6 +648,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
||||||
ShowConfirmExit = new ReactiveObject<bool>();
|
ShowConfirmExit = new ReactiveObject<bool>();
|
||||||
HideCursor = new ReactiveObject<HideCursorMode>();
|
HideCursor = new ReactiveObject<HideCursorMode>();
|
||||||
|
CursorHideIdleTime = new ReactiveObject<int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationFileFormat ToFileFormat()
|
public ConfigurationFileFormat ToFileFormat()
|
||||||
|
@ -679,6 +685,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
||||||
ShowConfirmExit = ShowConfirmExit,
|
ShowConfirmExit = ShowConfirmExit,
|
||||||
HideCursor = HideCursor,
|
HideCursor = HideCursor,
|
||||||
|
CursorHideIdleTime = CursorHideIdleTime,
|
||||||
EnableVsync = Graphics.EnableVsync,
|
EnableVsync = Graphics.EnableVsync,
|
||||||
EnableShaderCache = Graphics.EnableShaderCache,
|
EnableShaderCache = Graphics.EnableShaderCache,
|
||||||
EnableTextureRecompression = Graphics.EnableTextureRecompression,
|
EnableTextureRecompression = Graphics.EnableTextureRecompression,
|
||||||
|
@ -1077,6 +1084,8 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
|
|
||||||
configurationFileFormat.HideCursor = HideCursorMode.Never;
|
configurationFileFormat.HideCursor = HideCursorMode.Never;
|
||||||
|
|
||||||
|
configurationFileFormat.CursorHideIdleTime = 5;
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1473,6 +1482,7 @@ namespace Ryujinx.UI.Common.Configuration
|
||||||
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
||||||
HideCursor.Value = configurationFileFormat.HideCursor;
|
HideCursor.Value = configurationFileFormat.HideCursor;
|
||||||
|
CursorHideIdleTime.Value = configurationFileFormat.CursorHideIdleTime;
|
||||||
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
||||||
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
||||||
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
|
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Ryujinx.Ava
|
||||||
{
|
{
|
||||||
internal class AppHost
|
internal class AppHost
|
||||||
{
|
{
|
||||||
private const int CursorHideIdleTime = 5; // Hide Cursor seconds.
|
private readonly int CursorHideIdleTime; // Hide Cursor seconds.
|
||||||
private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping.
|
private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping.
|
||||||
private const int TargetFps = 60;
|
private const int TargetFps = 60;
|
||||||
private const float VolumeDelta = 0.05f;
|
private const float VolumeDelta = 0.05f;
|
||||||
|
@ -144,6 +144,8 @@ namespace Ryujinx.Ava
|
||||||
_glLogLevel = ConfigurationState.Instance.Logger.GraphicsDebugLevel;
|
_glLogLevel = ConfigurationState.Instance.Logger.GraphicsDebugLevel;
|
||||||
_topLevel = topLevel;
|
_topLevel = topLevel;
|
||||||
|
|
||||||
|
CursorHideIdleTime = ConfigurationState.Instance.CursorHideIdleTime;
|
||||||
|
|
||||||
_inputManager.SetMouseDriver(new AvaloniaMouseDriver(_topLevel, renderer));
|
_inputManager.SetMouseDriver(new AvaloniaMouseDriver(_topLevel, renderer));
|
||||||
|
|
||||||
_keyboardInterface = (IKeyboard)_inputManager.KeyboardDriver.GetGamepad("0");
|
_keyboardInterface = (IKeyboard)_inputManager.KeyboardDriver.GetGamepad("0");
|
||||||
|
|
|
@ -96,6 +96,7 @@
|
||||||
"SettingsTabGeneralHideCursorNever": "Never",
|
"SettingsTabGeneralHideCursorNever": "Never",
|
||||||
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
||||||
"SettingsTabGeneralHideCursorAlways": "Always",
|
"SettingsTabGeneralHideCursorAlways": "Always",
|
||||||
|
"SettingsTabGeneralCursorHideIdleTime": "CursorHideIdleTime",
|
||||||
"SettingsTabGeneralGameDirectories": "Game Directories",
|
"SettingsTabGeneralGameDirectories": "Game Directories",
|
||||||
"SettingsTabGeneralAdd": "Add",
|
"SettingsTabGeneralAdd": "Add",
|
||||||
"SettingsTabGeneralRemove": "Remove",
|
"SettingsTabGeneralRemove": "Remove",
|
||||||
|
|
|
@ -133,6 +133,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
public bool CheckUpdatesOnStart { get; set; }
|
public bool CheckUpdatesOnStart { get; set; }
|
||||||
public bool ShowConfirmExit { get; set; }
|
public bool ShowConfirmExit { get; set; }
|
||||||
public int HideCursor { get; set; }
|
public int HideCursor { get; set; }
|
||||||
|
public int CursorHideIdleTime { get; set; }
|
||||||
public bool EnableDockedMode { get; set; }
|
public bool EnableDockedMode { get; set; }
|
||||||
public bool EnableKeyboard { get; set; }
|
public bool EnableKeyboard { get; set; }
|
||||||
public bool EnableMouse { get; set; }
|
public bool EnableMouse { get; set; }
|
||||||
|
@ -406,6 +407,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
||||||
ShowConfirmExit = config.ShowConfirmExit;
|
ShowConfirmExit = config.ShowConfirmExit;
|
||||||
HideCursor = (int)config.HideCursor.Value;
|
HideCursor = (int)config.HideCursor.Value;
|
||||||
|
CursorHideIdleTime = config.CursorHideIdleTime.Value;
|
||||||
|
|
||||||
GameDirectories.Clear();
|
GameDirectories.Clear();
|
||||||
GameDirectories.AddRange(config.UI.GameDirs.Value);
|
GameDirectories.AddRange(config.UI.GameDirs.Value);
|
||||||
|
@ -490,6 +492,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||||
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||||
|
config.CursorHideIdleTime.Value = CursorHideIdleTime;
|
||||||
|
|
||||||
if (_directoryChanged)
|
if (_directoryChanged)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsUiView"
|
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsUiView"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||||
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:DataType="viewModels:SettingsViewModel">
|
x:DataType="viewModels:SettingsViewModel">
|
||||||
|
@ -53,6 +54,16 @@
|
||||||
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorAlways}" />
|
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorAlways}" />
|
||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
<TextBlock
|
||||||
|
Margin="20, 0, 0, 0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{locale:Locale SettingsTabGeneralCursorHideIdleTime}"
|
||||||
|
Width="150" />
|
||||||
|
<NumericUpDown
|
||||||
|
Maximum="60"
|
||||||
|
Minimum="0"
|
||||||
|
Width="120"
|
||||||
|
Value="{Binding CursorHideIdleTime}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Margin="0, 15, 0, 10" Orientation="Horizontal">
|
<StackPanel Margin="0, 15, 0, 10" Orientation="Horizontal">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue