mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
[FancyZones] Restore size of zoned windows (#4463)
* Started work * I can't debug anything, cleaning * Added settings, [[Not Tested]] Not even compiled * Tested, the most basic features work * Refactor, add RestoreSize * Added DPI awareness * Fixed a potential issue with resizing zoned windows * Fixup: Potentially unsafe memory-layout of std::pair replaced with std::array * Fixup: Use .data() instead of a pointer * Further refactoring * Integrated Win+Arrow keys with the Restore size feature * Fixed an issue where window's on-screen position is not restored properly * Fixed a bug pointed out by Enrico
This commit is contained in:
@@ -194,6 +194,24 @@ namespace ViewModelTests
|
||||
viewModel.AppLastZoneMoveWindows = true;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void RestoreSize_ShouldSetValue2True_WhenSuccessful()
|
||||
{
|
||||
// arrange
|
||||
FancyZonesViewModel viewModel = new FancyZonesViewModel();
|
||||
Assert.IsFalse(viewModel.RestoreSize); // check if value was initialized to false.
|
||||
|
||||
// Assert
|
||||
ShellPage.DefaultSndMSGCallback = msg =>
|
||||
{
|
||||
FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize<FancyZonesSettingsIPCMessage>(msg);
|
||||
Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesRestoreSize.Value);
|
||||
};
|
||||
|
||||
// act
|
||||
viewModel.RestoreSize = true;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void UseCursorPosEditorStartupScreen_ShouldSetValue2False_WhenSuccessful()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user