Skip to content

Commit

Permalink
[Awake][Settings]Don't hide "Keep screen on" (#23575)
Browse files Browse the repository at this point in the history
* [Awake][Settings]Don't hide "Keep screen on"

* Change tray menu as well
  • Loading branch information
jaimecbernardo authored Jan 24, 2023
1 parent 6f0b16d commit 97e5e22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/awake/Awake/Core/TrayHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static void SetTray(string text, bool keepDisplayOn, AwakeMode mode, Dict
PInvoke.InsertMenu(TrayMenu, 0, MENU_ITEM_FLAGS.MF_BYPOSITION | MENU_ITEM_FLAGS.MF_SEPARATOR, 0, string.Empty);
}

PInvoke.InsertMenu(TrayMenu, 0, MENU_ITEM_FLAGS.MF_BYPOSITION | MENU_ITEM_FLAGS.MF_STRING | (keepDisplayOn ? MENU_ITEM_FLAGS.MF_CHECKED : MENU_ITEM_FLAGS.MF_UNCHECKED), (uint)TrayCommands.TC_DISPLAY_SETTING, "Keep screen on");
PInvoke.InsertMenu(TrayMenu, 0, MENU_ITEM_FLAGS.MF_BYPOSITION | MENU_ITEM_FLAGS.MF_STRING | (keepDisplayOn ? MENU_ITEM_FLAGS.MF_CHECKED : MENU_ITEM_FLAGS.MF_UNCHECKED) | (mode == AwakeMode.PASSIVE ? MENU_ITEM_FLAGS.MF_DISABLED : MENU_ITEM_FLAGS.MF_ENABLED), (uint)TrayCommands.TC_DISPLAY_SETTING, "Keep screen on");
}

// In case there are no tray shortcuts defined for the application default to a
Expand Down
3 changes: 3 additions & 0 deletions src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,9 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="Awake_EnableDisplayKeepAwake.Header" xml:space="preserve">
<value>Keep screen on</value>
</data>
<data name="Awake_EnableDisplayKeepAwake.Description" xml:space="preserve">
<value>This setting is only available when keeping the PC awake</value>
</data>
<data name="Awake_Mode.Header" xml:space="preserve">
<value>Mode</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion src/settings-ui/Settings.UI/Views/AwakePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<labs:SettingsCard
x:Uid="Awake_EnableDisplayKeepAwake"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE7FB;}"
Visibility="{x:Bind ViewModel.IsScreenConfigurationPossibleEnabled, Mode=OneWay}">
IsEnabled="{x:Bind ViewModel.IsScreenConfigurationPossibleEnabled, Mode=OneWay}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" />
Expand Down

0 comments on commit 97e5e22

Please sign in to comment.