[FancyZones Editor] Reset layout (#8114)

Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
This commit is contained in:
Seraphima Zykova
2020-11-19 10:03:22 +03:00
committed by GitHub
parent 1735be1cc2
commit 854ea0e5ac
10 changed files with 77 additions and 20 deletions

View File

@@ -193,6 +193,7 @@ namespace FancyZonesEditor
{
LayoutModel.SerializeDeletedCustomZoneSets();
App.Overlay.CloseLayoutWindow();
App.Current.Shutdown();
}
private void OnInitialized(object sender, EventArgs e)
@@ -242,5 +243,28 @@ namespace FancyZonesEditor
{
this.Close();
}
private void Reset_Click(object sender, RoutedEventArgs e)
{
var overlay = App.Overlay;
MainWindowSettingsModel settings = ((App)Application.Current).MainWindowSettings;
if (overlay.CurrentDataContext is LayoutModel model)
{
model.IsSelected = false;
model.IsApplied = false;
}
overlay.CurrentLayoutSettings.ZonesetUuid = settings.BlankModel.Uuid;
overlay.CurrentLayoutSettings.Type = LayoutType.Blank;
overlay.CurrentDataContext = settings.BlankModel;
App.FancyZonesEditorIO.SerializeAppliedLayouts();
if (!overlay.MultiMonitorMode)
{
Close();
}
}
}
}