[settings] Fix OOBE size and make it non-resizable & Bring back Settings window placement preserve logic (#17822)

* Fix OOBE size and make it non-resizable
Bring back Settings window placement preserve logic

* Disable OOBE maximize&minimize

* expect.txt

* Remove uneeded line

* Remove uneeded check

* Add brackets
This commit is contained in:
Stefan Markovic
2022-04-20 17:08:25 +02:00
committed by GitHub
parent 40300c1e4f
commit b3c520ed54
4 changed files with 70 additions and 0 deletions

View File

@@ -3,7 +3,9 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Drawing;
using Microsoft.PowerLauncher.Telemetry;
using Microsoft.PowerToys.Settings.UI.Helpers;
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
using Microsoft.PowerToys.Settings.UI.Views;
using Microsoft.PowerToys.Telemetry;
@@ -34,6 +36,9 @@ namespace Microsoft.PowerToys.Settings.UI
AppWindow appWindow = AppWindow.GetFromWindowId(windowId);
appWindow.SetIcon("icon.ico");
var placement = Utils.DeserializePlacementOrDefault(hWnd);
NativeMethods.SetWindowPlacement(hWnd, ref placement);
ResourceLoader loader = ResourceLoader.GetForViewIndependentUse();
Title = loader.GetString("SettingsWindow_Title");
@@ -103,6 +108,9 @@ namespace Microsoft.PowerToys.Settings.UI
private void Window_Closed(object sender, WindowEventArgs args)
{
App.ClearSettingsWindow();
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
Utils.SerializePlacement(hWnd);
}
}
}