Win arrows revisited (#5932)

* Added the setting

* Refactored existing code, the main feature isn't implemented yet

* Renamed a method

* Updated a comment in IZoneWindow

* Added the zone selection algorithm, didn't test it

* Basic features work

* Single monitor cycling works

* Seems that the feature works well

* Polished the settings page

* Rebase fix

* Fixed a null pointer dereference

* Use classic if syntax

* Fixed bad indentation

How did these lines unindent themselves?

* Removed TODO comment

* Rebase fix

* Another rebase fix
This commit is contained in:
Ivan Stošić
2020-08-21 12:53:03 +02:00
committed by GitHub
parent 64c51a49a0
commit 976116a012
24 changed files with 657 additions and 173 deletions

View File

@@ -17,6 +17,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
FancyzonesOverrideSnapHotkeys = new BoolProperty();
FancyzonesMouseSwitch = new BoolProperty();
FancyzonesMoveWindowsAcrossMonitors = new BoolProperty();
FancyzonesMoveWindowsBasedOnPosition = new BoolProperty();
FancyzonesDisplayChangeMoveWindows = new BoolProperty();
FancyzonesZoneSetChangeMoveWindows = new BoolProperty();
FancyzonesAppLastZoneMoveWindows = new BoolProperty();
@@ -46,6 +47,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
[JsonPropertyName("fancyzones_moveWindowAcrossMonitors")]
public BoolProperty FancyzonesMoveWindowsAcrossMonitors { get; set; }
[JsonPropertyName("fancyzones_moveWindowsBasedOnPosition")]
public BoolProperty FancyzonesMoveWindowsBasedOnPosition { get; set; }
[JsonPropertyName("fancyzones_displayChange_moveWindows")]
public BoolProperty FancyzonesDisplayChangeMoveWindows { get; set; }

View File

@@ -41,6 +41,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
_mouseSwitch = Settings.Properties.FancyzonesMouseSwitch.Value;
_overrideSnapHotkeys = Settings.Properties.FancyzonesOverrideSnapHotkeys.Value;
_moveWindowsAcrossMonitors = Settings.Properties.FancyzonesMoveWindowsAcrossMonitors.Value;
_moveWindowsBasedOnPosition = Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value;
_displayChangemoveWindows = Settings.Properties.FancyzonesDisplayChangeMoveWindows.Value;
_zoneSetChangeMoveWindows = Settings.Properties.FancyzonesZoneSetChangeMoveWindows.Value;
_appLastZoneMoveWindows = Settings.Properties.FancyzonesAppLastZoneMoveWindows.Value;
@@ -84,6 +85,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
private bool _mouseSwitch;
private bool _overrideSnapHotkeys;
private bool _moveWindowsAcrossMonitors;
private bool _moveWindowsBasedOnPosition;
private bool _displayChangemoveWindows;
private bool _zoneSetChangeMoveWindows;
private bool _appLastZoneMoveWindows;
@@ -119,10 +121,19 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
SendConfigMSG(snd.ToString());
OnPropertyChanged("IsEnabled");
OnPropertyChanged("SnapHotkeysCategoryEnabled");
}
}
}
public bool SnapHotkeysCategoryEnabled
{
get
{
return _isEnabled && _overrideSnapHotkeys;
}
}
public bool ShiftDrag
{
get
@@ -178,6 +189,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
_overrideSnapHotkeys = value;
Settings.Properties.FancyzonesOverrideSnapHotkeys.Value = value;
RaisePropertyChanged();
OnPropertyChanged("SnapHotkeysCategoryEnabled");
}
}
}
@@ -200,6 +212,24 @@ namespace Microsoft.PowerToys.Settings.UI.Lib.ViewModels
}
}
public bool MoveWindowsBasedOnPosition
{
get
{
return _moveWindowsBasedOnPosition;
}
set
{
if (value != _moveWindowsBasedOnPosition)
{
_moveWindowsBasedOnPosition = value;
Settings.Properties.FancyzonesMoveWindowsBasedOnPosition.Value = value;
RaisePropertyChanged();
}
}
}
public bool DisplayChangeMoveWindows
{
get