mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 17:42:45 +08:00
[Settings][Awake]Show display option on indefinite (#22596)
This commit is contained in:
parent
febe1aa9a0
commit
7d53b9a5b5
@ -76,6 +76,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
GeneralSettingsConfig.Enabled.Awake = value;
|
||||
OnPropertyChanged(nameof(IsEnabled));
|
||||
OnPropertyChanged(nameof(IsTimeConfigurationEnabled));
|
||||
OnPropertyChanged(nameof(IsScreenConfigurationPossibleEnabled));
|
||||
|
||||
OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(GeneralSettingsConfig);
|
||||
SendConfigMSG(outgoing.ToString());
|
||||
@ -94,6 +95,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
get => _mode == AwakeMode.TIMED && _isEnabled;
|
||||
}
|
||||
|
||||
public bool IsScreenConfigurationPossibleEnabled
|
||||
{
|
||||
get => _mode != AwakeMode.PASSIVE && _isEnabled;
|
||||
}
|
||||
|
||||
public AwakeMode Mode
|
||||
{
|
||||
get => _mode;
|
||||
@ -104,6 +110,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_mode = value;
|
||||
OnPropertyChanged(nameof(Mode));
|
||||
OnPropertyChanged(nameof(IsTimeConfigurationEnabled));
|
||||
OnPropertyChanged(nameof(IsScreenConfigurationPossibleEnabled));
|
||||
|
||||
Settings.Properties.Mode = value;
|
||||
NotifyPropertyChanged();
|
||||
|
@ -83,7 +83,7 @@
|
||||
<labs:SettingsCard
|
||||
x:Uid="Awake_EnableDisplayKeepAwake"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=}"
|
||||
Visibility="{x:Bind ViewModel.IsTimeConfigurationEnabled, Mode=OneWay}">
|
||||
Visibility="{x:Bind ViewModel.IsScreenConfigurationPossibleEnabled, Mode=OneWay}">
|
||||
<ToggleSwitch
|
||||
x:Uid="ToggleSwitch"
|
||||
IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" />
|
||||
|
Loading…
Reference in New Issue
Block a user