[Settings][Awake]Show display option on indefinite (#22596)

This commit is contained in:
Jaime Bernardo
2022-12-09 16:27:49 +00:00
committed by GitHub
parent febe1aa9a0
commit 7d53b9a5b5
2 changed files with 8 additions and 1 deletions

View File

@@ -76,6 +76,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
GeneralSettingsConfig.Enabled.Awake = value; GeneralSettingsConfig.Enabled.Awake = value;
OnPropertyChanged(nameof(IsEnabled)); OnPropertyChanged(nameof(IsEnabled));
OnPropertyChanged(nameof(IsTimeConfigurationEnabled)); OnPropertyChanged(nameof(IsTimeConfigurationEnabled));
OnPropertyChanged(nameof(IsScreenConfigurationPossibleEnabled));
OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(GeneralSettingsConfig); OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(GeneralSettingsConfig);
SendConfigMSG(outgoing.ToString()); SendConfigMSG(outgoing.ToString());
@@ -94,6 +95,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
get => _mode == AwakeMode.TIMED && _isEnabled; get => _mode == AwakeMode.TIMED && _isEnabled;
} }
public bool IsScreenConfigurationPossibleEnabled
{
get => _mode != AwakeMode.PASSIVE && _isEnabled;
}
public AwakeMode Mode public AwakeMode Mode
{ {
get => _mode; get => _mode;
@@ -104,6 +110,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_mode = value; _mode = value;
OnPropertyChanged(nameof(Mode)); OnPropertyChanged(nameof(Mode));
OnPropertyChanged(nameof(IsTimeConfigurationEnabled)); OnPropertyChanged(nameof(IsTimeConfigurationEnabled));
OnPropertyChanged(nameof(IsScreenConfigurationPossibleEnabled));
Settings.Properties.Mode = value; Settings.Properties.Mode = value;
NotifyPropertyChanged(); NotifyPropertyChanged();

View File

@@ -83,7 +83,7 @@
<labs:SettingsCard <labs:SettingsCard
x:Uid="Awake_EnableDisplayKeepAwake" x:Uid="Awake_EnableDisplayKeepAwake"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE7FB;}" HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE7FB;}"
Visibility="{x:Bind ViewModel.IsTimeConfigurationEnabled, Mode=OneWay}"> Visibility="{x:Bind ViewModel.IsScreenConfigurationPossibleEnabled, Mode=OneWay}">
<ToggleSwitch <ToggleSwitch
x:Uid="ToggleSwitch" x:Uid="ToggleSwitch"
IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" /> IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" />