mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
[FancyZones] Open window on active monitor (#4361)
* Initial design for opening window on active monitor * Perform entire handling in DPI unaware thread * Codestyle improvement * Improve resizing mechanism and optimise code a bit * Remove unneeded code, make simple helper functions inline * Make this feature configurable * Code optimization, improve positioning for some applications * Retry positioning for certain applications * Improve readability * Address PR comments: Minor code style improvements * Remove retries in custom positioning * Position new toggle in settings menu
This commit is contained in:
@@ -194,6 +194,23 @@ namespace ViewModelTests
|
||||
viewModel.AppLastZoneMoveWindows = true;
|
||||
}
|
||||
|
||||
public void OpenWindowOnActiveMonitor_ShouldSetValue2True_WhenSuccessful()
|
||||
{
|
||||
// arrange
|
||||
FancyZonesViewModel viewModel = new FancyZonesViewModel();
|
||||
Assert.IsFalse(viewModel.OpenWindowOnActiveMonitor); // check if value was initialized to false.
|
||||
|
||||
// Assert
|
||||
ShellPage.DefaultSndMSGCallback = msg =>
|
||||
{
|
||||
FancyZonesSettingsIPCMessage snd = JsonSerializer.Deserialize<FancyZonesSettingsIPCMessage>(msg);
|
||||
Assert.IsTrue(snd.Powertoys.FancyZones.Properties.FancyzonesOpenWindowOnActiveMonitor.Value);
|
||||
};
|
||||
|
||||
// act
|
||||
viewModel.OpenWindowOnActiveMonitor = true;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void RestoreSize_ShouldSetValue2True_WhenSuccessful()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user