Skip to content

Commit

Permalink
[FZ Editor] Update the small layout preview after canceling zone edit…
Browse files Browse the repository at this point in the history
…ing. (#9391)
  • Loading branch information
SeraphimaZykova committed Feb 2, 2021
1 parent f309f48 commit 612f3e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/modules/fancyzones/editor/FancyZonesEditor/EditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,17 @@ protected void OnSaveApplyTemplate(object sender, RoutedEventArgs e)

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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ private void AddNewZone()
{
_topLeft = DefaultOffset;
}
else if (_topLeft == Zones[Zones.Count - 1].X)
{
_topLeft += OffsetShift;
}

Rect workingArea = App.Overlay.WorkArea;
int topLeft = (int)App.Overlay.ScaleCoordinateWithCurrentMonitorDpi(_topLeft);
Expand Down Expand Up @@ -155,7 +159,9 @@ public void RestoreTo(CanvasLayoutModel other)
other.Zones.Add(zone);
}

other._topLeft = _topLeft;
other.SensitivityRadius = SensitivityRadius;
other.UpdateLayout();
}

// PersistData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ public void RestoreTo(GridLayoutModel layout)
layout.ShowSpacing = ShowSpacing;
layout.Spacing = Spacing;
layout.SensitivityRadius = SensitivityRadius;

layout.FirePropertyChanged();
}

// InitTemplateZones
Expand Down

0 comments on commit 612f3e2

Please sign in to comment.