mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Settings][Awake]Show display option on indefinite (#22596)
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<labs:SettingsCard
|
<labs:SettingsCard
|
||||||
x:Uid="Awake_EnableDisplayKeepAwake"
|
x:Uid="Awake_EnableDisplayKeepAwake"
|
||||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=}"
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=}"
|
||||||
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}" />
|
||||||
|
|||||||
Reference in New Issue
Block a user