[FZ Editor] Update the small layout preview after canceling zone editing. (#9391)

This commit is contained in:
Seraphima Zykova
2021-02-02 11:15:05 +03:00
committed by GitHub
parent f309f48ae2
commit 612f3e20ac
3 changed files with 9 additions and 9 deletions

View File

@@ -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;
} }
} }

View File

@@ -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

View File

@@ -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