[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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -31,25 +31,17 @@ namespace FancyZonesEditor
App.FancyZonesEditorIO.SerializeZoneSettings();
_backToLayoutPicker = false;
Close();
mainEditor.CloseEditor();
}
protected void OnClosed(object sender, EventArgs e)
{
if (_backToLayoutPicker)
{
App.Overlay.CloseEditor();
}
App.Overlay.CloseEditor();
}
protected void OnCancel(object sender, RoutedEventArgs e)
{
_backToLayoutPicker = true;
Close();
}
private bool _backToLayoutPicker = true;
}
}

View file

@ -91,6 +91,10 @@ namespace FancyZonesEditor.Models
{
_topLeft = DefaultOffset;
}
else if (_topLeft == Zones[Zones.Count - 1].X)
{
_topLeft += OffsetShift;
}
Rect workingArea = App.Overlay.WorkArea;
int topLeft = (int)App.Overlay.ScaleCoordinateWithCurrentMonitorDpi(_topLeft);
@ -155,7 +159,9 @@ namespace FancyZonesEditor.Models
other.Zones.Add(zone);
}
other._topLeft = _topLeft;
other.SensitivityRadius = SensitivityRadius;
other.UpdateLayout();
}
// PersistData

View file

@ -263,6 +263,8 @@ namespace FancyZonesEditor.Models
layout.ShowSpacing = ShowSpacing;
layout.Spacing = Spacing;
layout.SensitivityRadius = SensitivityRadius;
layout.FirePropertyChanged();
}
// InitTemplateZones