mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[Settings]React on OS theme change fix (#29944)
* [Settings] React on OS theme change fix * Fix new OobeWindow call after merge
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
private IntPtr _hWnd;
|
||||
private AppWindow _appWindow;
|
||||
|
||||
public OobeWindow(PowerToysModules initialModule, bool isDark)
|
||||
public OobeWindow(PowerToysModules initialModule)
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
@@ -42,14 +42,6 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
_appWindow = AppWindow.GetFromWindowId(_windowId);
|
||||
_appWindow.SetIcon("Assets\\Settings\\icon.ico");
|
||||
|
||||
// Passed by parameter, as it needs to be evaluated ASAP, otherwise there is a white flash
|
||||
if (isDark)
|
||||
{
|
||||
ThemeHelpers.SetImmersiveDarkMode(_hWnd, isDark);
|
||||
}
|
||||
|
||||
SetTheme(isDark);
|
||||
|
||||
OverlappedPresenter presenter = _appWindow.Presenter as OverlappedPresenter;
|
||||
presenter.IsMinimizable = false;
|
||||
presenter.IsMaximizable = false;
|
||||
@@ -140,10 +132,5 @@ namespace Microsoft.PowerToys.Settings.UI
|
||||
mainWindow.CloseHiddenWindow();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTheme(bool isDark)
|
||||
{
|
||||
shellPage.RequestedTheme = isDark ? ElementTheme.Dark : ElementTheme.Light;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user