mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[FancyZones] "Match not found" error fix (#11840)
This commit is contained in:
@@ -21,24 +21,20 @@ namespace FancyZonesEditor.Utils
|
||||
|
||||
public int Dpi { get; set; }
|
||||
|
||||
public bool Primary { get; private set; }
|
||||
|
||||
public Device(string id, int dpi, Rect bounds, Rect workArea, bool primary)
|
||||
public Device(string id, int dpi, Rect bounds, Rect workArea)
|
||||
{
|
||||
Id = id;
|
||||
Dpi = dpi;
|
||||
WorkAreaRect = workArea;
|
||||
UnscaledBounds = bounds;
|
||||
ScaledBounds = bounds;
|
||||
Primary = primary;
|
||||
}
|
||||
|
||||
public Device(Rect bounds, Rect workArea, bool primary)
|
||||
public Device(Rect bounds, Rect workArea)
|
||||
{
|
||||
WorkAreaRect = workArea;
|
||||
UnscaledBounds = bounds;
|
||||
ScaledBounds = bounds;
|
||||
Primary = primary;
|
||||
}
|
||||
|
||||
public void Scale(double scaleFactor)
|
||||
@@ -61,7 +57,6 @@ namespace FancyZonesEditor.Utils
|
||||
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "ID: {0}{1}", Id, Environment.NewLine);
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "DPI: {0}{1}", Dpi, Environment.NewLine);
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "Is primary: {0}{1}", Primary, Environment.NewLine);
|
||||
|
||||
string workArea = string.Format(CultureInfo.InvariantCulture, "({0}, {1}, {2}, {3})", WorkAreaRect.X, WorkAreaRect.Y, WorkAreaRect.Width, WorkAreaRect.Height);
|
||||
string bounds = string.Format(CultureInfo.InvariantCulture, "({0}, {1}, {2}, {3})", UnscaledBounds.X, UnscaledBounds.Y, UnscaledBounds.Width, UnscaledBounds.Height);
|
||||
|
||||
@@ -187,6 +187,14 @@ namespace FancyZonesEditor
|
||||
return model.Type != LayoutType.Custom;
|
||||
}
|
||||
|
||||
public void InitModels()
|
||||
{
|
||||
foreach (var model in DefaultModels)
|
||||
{
|
||||
model.InitTemplateZones();
|
||||
}
|
||||
}
|
||||
|
||||
public LayoutModel UpdateSelectedLayoutModel()
|
||||
{
|
||||
LayoutModel foundModel = null;
|
||||
|
||||
@@ -18,11 +18,11 @@ namespace FancyZonesEditor.Models
|
||||
|
||||
public Device Device { get; set; }
|
||||
|
||||
public Monitor(Rect bounds, Rect workArea, bool primary)
|
||||
public Monitor(Rect bounds, Rect workArea)
|
||||
{
|
||||
Window = new LayoutOverlayWindow();
|
||||
Settings = new LayoutSettings();
|
||||
Device = new Device(bounds, workArea, primary);
|
||||
Device = new Device(bounds, workArea);
|
||||
|
||||
if (App.DebugMode)
|
||||
{
|
||||
@@ -41,10 +41,10 @@ namespace FancyZonesEditor.Models
|
||||
Window.Height = workArea.Height;
|
||||
}
|
||||
|
||||
public Monitor(string id, int dpi, Rect bounds, Rect workArea, bool primary)
|
||||
: this(bounds, workArea, primary)
|
||||
public Monitor(string id, int dpi, Rect bounds, Rect workArea)
|
||||
: this(bounds, workArea)
|
||||
{
|
||||
Device = new Device(id, dpi, bounds, workArea, primary);
|
||||
Device = new Device(id, dpi, bounds, workArea);
|
||||
}
|
||||
|
||||
public void Scale(double scaleFactor)
|
||||
|
||||
Reference in New Issue
Block a user