mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[FancyZones Editor] Reset layout (#8114)
Co-authored-by: Enrico Giordani <enricogior@users.noreply.github.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user