mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[FZ Editor] Update the small layout preview after canceling zone editing. (#9391)
This commit is contained in:
@@ -31,25 +31,17 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
App.FancyZonesEditorIO.SerializeZoneSettings();
|
App.FancyZonesEditorIO.SerializeZoneSettings();
|
||||||
|
|
||||||
_backToLayoutPicker = false;
|
|
||||||
Close();
|
Close();
|
||||||
mainEditor.CloseEditor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnClosed(object sender, EventArgs e)
|
protected void OnClosed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_backToLayoutPicker)
|
App.Overlay.CloseEditor();
|
||||||
{
|
|
||||||
App.Overlay.CloseEditor();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnCancel(object sender, RoutedEventArgs e)
|
protected void OnCancel(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_backToLayoutPicker = true;
|
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _backToLayoutPicker = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ namespace FancyZonesEditor.Models
|
|||||||
{
|
{
|
||||||
_topLeft = DefaultOffset;
|
_topLeft = DefaultOffset;
|
||||||
}
|
}
|
||||||
|
else if (_topLeft == Zones[Zones.Count - 1].X)
|
||||||
|
{
|
||||||
|
_topLeft += OffsetShift;
|
||||||
|
}
|
||||||
|
|
||||||
Rect workingArea = App.Overlay.WorkArea;
|
Rect workingArea = App.Overlay.WorkArea;
|
||||||
int topLeft = (int)App.Overlay.ScaleCoordinateWithCurrentMonitorDpi(_topLeft);
|
int topLeft = (int)App.Overlay.ScaleCoordinateWithCurrentMonitorDpi(_topLeft);
|
||||||
@@ -155,7 +159,9 @@ namespace FancyZonesEditor.Models
|
|||||||
other.Zones.Add(zone);
|
other.Zones.Add(zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
other._topLeft = _topLeft;
|
||||||
other.SensitivityRadius = SensitivityRadius;
|
other.SensitivityRadius = SensitivityRadius;
|
||||||
|
other.UpdateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// PersistData
|
// PersistData
|
||||||
|
|||||||
@@ -263,6 +263,8 @@ namespace FancyZonesEditor.Models
|
|||||||
layout.ShowSpacing = ShowSpacing;
|
layout.ShowSpacing = ShowSpacing;
|
||||||
layout.Spacing = Spacing;
|
layout.Spacing = Spacing;
|
||||||
layout.SensitivityRadius = SensitivityRadius;
|
layout.SensitivityRadius = SensitivityRadius;
|
||||||
|
|
||||||
|
layout.FirePropertyChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitTemplateZones
|
// InitTemplateZones
|
||||||
|
|||||||
Reference in New Issue
Block a user