mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[QuickAccent]Add a setting for the menu delay time (#20221)
This commit is contained in:
@@ -16,10 +16,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonPropertyName("toolbar_position")]
|
||||
public StringProperty ToolbarPosition { get; set; }
|
||||
|
||||
[JsonPropertyName("input_time_ms")]
|
||||
public IntProperty InputTime { get; set; }
|
||||
|
||||
public PowerAccentProperties()
|
||||
{
|
||||
ActivationKey = PowerAccentActivationKey.Both;
|
||||
ToolbarPosition = "Top center";
|
||||
InputTime = new IntProperty(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
_powerAccentSettings = new PowerAccentSettings();
|
||||
}
|
||||
|
||||
_inputTimeMs = _powerAccentSettings.Properties.InputTime.Value;
|
||||
|
||||
switch (_powerAccentSettings.Properties.ToolbarPosition.Value)
|
||||
{
|
||||
case "Top center":
|
||||
@@ -111,6 +113,27 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private int _inputTimeMs = 200;
|
||||
|
||||
public int InputTimeMs
|
||||
{
|
||||
get
|
||||
{
|
||||
return _inputTimeMs;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != _inputTimeMs)
|
||||
{
|
||||
_inputTimeMs = value;
|
||||
_powerAccentSettings.Properties.InputTime.Value = value;
|
||||
OnPropertyChanged(nameof(InputTimeMs));
|
||||
RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int _toolbarPositionIndex;
|
||||
|
||||
public int ToolbarPositionIndex
|
||||
|
||||
Reference in New Issue
Block a user