[FancyZones] Make snapping windows using Windows Snap Hotkeys across monitors optional (#2583)

* Make moving window across monitors optional

* Update tests

* Address PR comment: Update description of the toggle
This commit is contained in:
stefansjfw
2020-05-01 16:17:16 +02:00
committed by GitHub
parent 8c4dbbfbec
commit e6b74b10eb
10 changed files with 67 additions and 39 deletions

View File

@@ -305,13 +305,14 @@ namespace PowerToysTests
JObject savedProps = GetProperties();
Assert.AreNotEqual(toggleValues[0], GetPropertyValue<bool>(savedProps, "fancyzones_shiftDrag"));
Assert.AreNotEqual(toggleValues[1], GetPropertyValue<bool>(savedProps, "fancyzones_overrideSnapHotkeys"));
Assert.AreNotEqual(toggleValues[2], GetPropertyValue<bool>(savedProps, "fancyzones_displayChange_moveWindows"));
Assert.AreNotEqual(toggleValues[3], GetPropertyValue<bool>(savedProps, "fancyzones_zoneSetChange_moveWindows"));
Assert.AreNotEqual(toggleValues[4], GetPropertyValue<bool>(savedProps, "fancyzones_virtualDesktopChange_moveWindows"));
Assert.AreNotEqual(toggleValues[5], GetPropertyValue<bool>(savedProps, "fancyzones_appLastZone_moveWindows"));
Assert.AreNotEqual(toggleValues[6], GetPropertyValue<bool>(savedProps, "use_cursorpos_editor_startupscreen"));
Assert.AreNotEqual(toggleValues[7], GetPropertyValue<bool>(savedProps, "fancyzones_show_on_all_monitors"));
Assert.AreNotEqual(toggleValues[8], GetPropertyValue<bool>(savedProps, "fancyzones_makeDraggedWindowTransparent"));
Assert.AreNotEqual(toggleValues[2], GetPropertyValue<bool>(savedProps, "fancyzones_moveWindowAcrossMonitors"));
Assert.AreNotEqual(toggleValues[3], GetPropertyValue<bool>(savedProps, "fancyzones_displayChange_moveWindows"));
Assert.AreNotEqual(toggleValues[4], GetPropertyValue<bool>(savedProps, "fancyzones_zoneSetChange_moveWindows"));
Assert.AreNotEqual(toggleValues[5], GetPropertyValue<bool>(savedProps, "fancyzones_virtualDesktopChange_moveWindows"));
Assert.AreNotEqual(toggleValues[6], GetPropertyValue<bool>(savedProps, "fancyzones_appLastZone_moveWindows"));
Assert.AreNotEqual(toggleValues[7], GetPropertyValue<bool>(savedProps, "use_cursorpos_editor_startupscreen"));
Assert.AreNotEqual(toggleValues[8], GetPropertyValue<bool>(savedProps, "fancyzones_show_on_all_monitors"));
Assert.AreNotEqual(toggleValues[9], GetPropertyValue<bool>(savedProps, "fancyzones_makeDraggedWindowTransparent"));
}
/*
@@ -343,13 +344,14 @@ namespace PowerToysTests
JObject savedProps = GetProperties();
Assert.AreEqual(toggleValues[0], GetPropertyValue<bool>(savedProps, "fancyzones_shiftDrag"));
Assert.AreEqual(toggleValues[1], GetPropertyValue<bool>(savedProps, "fancyzones_overrideSnapHotkeys"));
Assert.AreEqual(toggleValues[2], GetPropertyValue<bool>(savedProps, "fancyzones_displayChange_moveWindows"));
Assert.AreEqual(toggleValues[3], GetPropertyValue<bool>(savedProps, "fancyzones_zoneSetChange_moveWindows"));
Assert.AreEqual(toggleValues[4], GetPropertyValue<bool>(savedProps, "fancyzones_virtualDesktopChange_moveWindows"));
Assert.AreEqual(toggleValues[5], GetPropertyValue<bool>(savedProps, "fancyzones_appLastZone_moveWindows"));
Assert.AreEqual(toggleValues[6], GetPropertyValue<bool>(savedProps, "use_cursorpos_editor_startupscreen"));
Assert.AreEqual(toggleValues[7], GetPropertyValue<bool>(savedProps, "fancyzones_show_on_all_monitors"));
Assert.AreEqual(toggleValues[8], GetPropertyValue<bool>(savedProps, "fancyzones_makeDraggedWindowTransparent"));
Assert.AreEqual(toggleValues[2], GetPropertyValue<bool>(savedProps, "fancyzones_moveWindowAcrossMonitors"));
Assert.AreEqual(toggleValues[3], GetPropertyValue<bool>(savedProps, "fancyzones_displayChange_moveWindows"));
Assert.AreEqual(toggleValues[4], GetPropertyValue<bool>(savedProps, "fancyzones_zoneSetChange_moveWindows"));
Assert.AreEqual(toggleValues[5], GetPropertyValue<bool>(savedProps, "fancyzones_virtualDesktopChange_moveWindows"));
Assert.AreEqual(toggleValues[6], GetPropertyValue<bool>(savedProps, "fancyzones_appLastZone_moveWindows"));
Assert.AreEqual(toggleValues[7], GetPropertyValue<bool>(savedProps, "use_cursorpos_editor_startupscreen"));
Assert.AreEqual(toggleValues[8], GetPropertyValue<bool>(savedProps, "fancyzones_show_on_all_monitors"));
Assert.AreEqual(toggleValues[9], GetPropertyValue<bool>(savedProps, "fancyzones_makeDraggedWindowTransparent"));
}
[TestMethod]

View File

@@ -26,7 +26,7 @@ namespace PowerToysTests
protected static string _initialSettings = "";
protected static string _initialZoneSettings = "";
protected const string _defaultSettings = "{\"version\":\"1.0\",\"name\":\"FancyZones\",\"properties\":{\"fancyzones_shiftDrag\":{\"value\":true},\"fancyzones_overrideSnapHotkeys\":{\"value\":false},\"fancyzones_zoneSetChange_flashZones\":{\"value\":false},\"fancyzones_displayChange_moveWindows\":{\"value\":false},\"fancyzones_zoneSetChange_moveWindows\":{\"value\":false},\"fancyzones_virtualDesktopChange_moveWindows\":{\"value\":false},\"fancyzones_appLastZone_moveWindows\":{\"value\":false},\"use_cursorpos_editor_startupscreen\":{\"value\":true},\"fancyzones_zoneHighlightColor\":{\"value\":\"#0078D7\"},\"fancyzones_highlight_opacity\":{\"value\":90},\"fancyzones_editor_hotkey\":{\"value\":{\"win\":true,\"ctrl\":false,\"alt\":false,\"shift\":false,\"code\":192,\"key\":\"`\"}},\"fancyzones_excluded_apps\":{\"value\":\"\"}}}";
protected const string _defaultSettings = "{\"version\":\"1.0\",\"name\":\"FancyZones\",\"properties\":{\"fancyzones_shiftDrag\":{\"value\":true},\"fancyzones_overrideSnapHotkeys\":{\"value\":false},\"fancyzones_moveWindowAcrossMonitors\":{\"value\":false},\"fancyzones_zoneSetChange_flashZones\":{\"value\":false},\"fancyzones_displayChange_moveWindows\":{\"value\":false},\"fancyzones_zoneSetChange_moveWindows\":{\"value\":false},\"fancyzones_virtualDesktopChange_moveWindows\":{\"value\":false},\"fancyzones_appLastZone_moveWindows\":{\"value\":false},\"use_cursorpos_editor_startupscreen\":{\"value\":true},\"fancyzones_zoneHighlightColor\":{\"value\":\"#0078D7\"},\"fancyzones_highlight_opacity\":{\"value\":90},\"fancyzones_editor_hotkey\":{\"value\":{\"win\":true,\"ctrl\":false,\"alt\":false,\"shift\":false,\"code\":192,\"key\":\"`\"}},\"fancyzones_excluded_apps\":{\"value\":\"\"}}}";
protected const string _defaultZoneSettings = "{\"app-zone-history\":[],\"devices\":[],\"custom-zone-sets\":[]}";