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>
|
||||
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>
|
||||
/// Enables or disables Vertical Sync
|
||||
/// </summary>
|
||||
|
|
|
@ -631,6 +631,11 @@ namespace Ryujinx.UI.Common.Configuration
|
|||
/// </summary>
|
||||
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()
|
||||
{
|
||||
UI = new UISection();
|
||||
|
@ -643,6 +648,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||
CheckUpdatesOnStart = new ReactiveObject<bool>();
|
||||
ShowConfirmExit = new ReactiveObject<bool>();
|
||||
HideCursor = new ReactiveObject<HideCursorMode>();
|
||||
CursorHideIdleTime = new ReactiveObject<int>();
|
||||
}
|
||||
|
||||
public ConfigurationFileFormat ToFileFormat()
|
||||
|
@ -679,6 +685,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||
CheckUpdatesOnStart = CheckUpdatesOnStart,
|
||||
ShowConfirmExit = ShowConfirmExit,
|
||||
HideCursor = HideCursor,
|
||||
CursorHideIdleTime = CursorHideIdleTime,
|
||||
EnableVsync = Graphics.EnableVsync,
|
||||
EnableShaderCache = Graphics.EnableShaderCache,
|
||||
EnableTextureRecompression = Graphics.EnableTextureRecompression,
|
||||
|
@ -1077,6 +1084,8 @@ namespace Ryujinx.UI.Common.Configuration
|
|||
|
||||
configurationFileFormat.HideCursor = HideCursorMode.Never;
|
||||
|
||||
configurationFileFormat.CursorHideIdleTime = 5;
|
||||
|
||||
configurationFileUpdated = true;
|
||||
}
|
||||
|
||||
|
@ -1473,6 +1482,7 @@ namespace Ryujinx.UI.Common.Configuration
|
|||
CheckUpdatesOnStart.Value = configurationFileFormat.CheckUpdatesOnStart;
|
||||
ShowConfirmExit.Value = configurationFileFormat.ShowConfirmExit;
|
||||
HideCursor.Value = configurationFileFormat.HideCursor;
|
||||
CursorHideIdleTime.Value = configurationFileFormat.CursorHideIdleTime;
|
||||
Graphics.EnableVsync.Value = configurationFileFormat.EnableVsync;
|
||||
Graphics.EnableShaderCache.Value = configurationFileFormat.EnableShaderCache;
|
||||
Graphics.EnableTextureRecompression.Value = configurationFileFormat.EnableTextureRecompression;
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace Ryujinx.Ava
|
|||
{
|
||||
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 int TargetFps = 60;
|
||||
private const float VolumeDelta = 0.05f;
|
||||
|
@ -144,6 +144,8 @@ namespace Ryujinx.Ava
|
|||
_glLogLevel = ConfigurationState.Instance.Logger.GraphicsDebugLevel;
|
||||
_topLevel = topLevel;
|
||||
|
||||
CursorHideIdleTime = ConfigurationState.Instance.CursorHideIdleTime;
|
||||
|
||||
_inputManager.SetMouseDriver(new AvaloniaMouseDriver(_topLevel, renderer));
|
||||
|
||||
_keyboardInterface = (IKeyboard)_inputManager.KeyboardDriver.GetGamepad("0");
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
"SettingsTabGeneralHideCursorNever": "Never",
|
||||
"SettingsTabGeneralHideCursorOnIdle": "On Idle",
|
||||
"SettingsTabGeneralHideCursorAlways": "Always",
|
||||
"SettingsTabGeneralCursorHideIdleTime": "CursorHideIdleTime",
|
||||
"SettingsTabGeneralGameDirectories": "Game Directories",
|
||||
"SettingsTabGeneralAdd": "Add",
|
||||
"SettingsTabGeneralRemove": "Remove",
|
||||
|
|
|
@ -133,6 +133,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
public bool CheckUpdatesOnStart { get; set; }
|
||||
public bool ShowConfirmExit { get; set; }
|
||||
public int HideCursor { get; set; }
|
||||
public int CursorHideIdleTime { get; set; }
|
||||
public bool EnableDockedMode { get; set; }
|
||||
public bool EnableKeyboard { get; set; }
|
||||
public bool EnableMouse { get; set; }
|
||||
|
@ -406,6 +407,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
CheckUpdatesOnStart = config.CheckUpdatesOnStart;
|
||||
ShowConfirmExit = config.ShowConfirmExit;
|
||||
HideCursor = (int)config.HideCursor.Value;
|
||||
CursorHideIdleTime = config.CursorHideIdleTime.Value;
|
||||
|
||||
GameDirectories.Clear();
|
||||
GameDirectories.AddRange(config.UI.GameDirs.Value);
|
||||
|
@ -490,6 +492,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart;
|
||||
config.ShowConfirmExit.Value = ShowConfirmExit;
|
||||
config.HideCursor.Value = (HideCursorMode)HideCursor;
|
||||
config.CursorHideIdleTime.Value = CursorHideIdleTime;
|
||||
|
||||
if (_directoryChanged)
|
||||
{
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<UserControl
|
||||
<UserControl
|
||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsUiView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
x:DataType="viewModels:SettingsViewModel">
|
||||
|
@ -53,6 +54,16 @@
|
|||
<TextBlock Text="{locale:Locale SettingsTabGeneralHideCursorAlways}" />
|
||||
</ComboBoxItem>
|
||||
</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 Margin="0, 15, 0, 10" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
|
|
Loading…
Add table
Reference in a new issue