mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
[FancyZones Editor] Prevent new zones from being unreachable (#4457)
* stack new zones * Changed startup location of window editor * Zones start in upper left * Changed Focus Zone Initialization * Zones.Add * Reset zone position when it goes off screen
This commit is contained in:
@@ -21,8 +21,18 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
private void OnAddZone(object sender, RoutedEventArgs e)
|
private void OnAddZone(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_model.AddZone(new Int32Rect(_offset, _offset, (int)(Settings.WorkArea.Width * 0.6), (int)(Settings.WorkArea.Height * 0.6)));
|
if (_offset + (int)(Settings.WorkArea.Width * 0.4) < (int)Settings.WorkArea.Width
|
||||||
_offset += 100;
|
&& _offset + (int)(Settings.WorkArea.Height * 0.4) < (int)Settings.WorkArea.Height)
|
||||||
|
{
|
||||||
|
_model.AddZone(new Int32Rect(_offset, _offset, (int)(Settings.WorkArea.Width * 0.4), (int)(Settings.WorkArea.Height * 0.4)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_offset = 100;
|
||||||
|
_model.AddZone(new Int32Rect(_offset, _offset, (int)(Settings.WorkArea.Width * 0.4), (int)(Settings.WorkArea.Height * 0.4)));
|
||||||
|
}
|
||||||
|
|
||||||
|
_offset += 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected new void OnCancel(object sender, RoutedEventArgs e)
|
protected new void OnCancel(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -292,9 +292,9 @@ namespace FancyZonesEditor
|
|||||||
ZoneCount = 3;
|
ZoneCount = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
Int32Rect focusZoneRect = new Int32Rect((int)(WorkArea.Width * 0.1), (int)(WorkArea.Height * 0.1), (int)(WorkArea.Width * 0.6), (int)(WorkArea.Height * 0.6));
|
Int32Rect focusZoneRect = new Int32Rect(100, 100, (int)(WorkArea.Width * 0.4), (int)(WorkArea.Height * 0.4));
|
||||||
int focusRectXIncrement = (ZoneCount <= 1) ? 0 : (int)(WorkArea.Width * 0.2) / (ZoneCount - 1);
|
int focusRectXIncrement = (ZoneCount <= 1) ? 0 : 50;
|
||||||
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : (int)(WorkArea.Height * 0.2) / (ZoneCount - 1);
|
int focusRectYIncrement = (ZoneCount <= 1) ? 0 : 50;
|
||||||
|
|
||||||
for (int i = 0; i < ZoneCount; i++)
|
for (int i = 0; i < ZoneCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user