mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
[FancyZones Editor] UI fixes (#18966)
* canvas scaling * moved editor params saving * show monitor size * removed unused cmd args * separate dpi unaware thread * tests * dpi unaware monitor size * spell * early return on editor params saving error * show scaling value * changed font
This commit is contained in:
@@ -79,12 +79,14 @@ namespace FancyZonesEditor
|
||||
|
||||
_themeManager = new ThemeManager(this);
|
||||
|
||||
if (!FancyZonesEditorIO.ParseParams().Result)
|
||||
var parseResult = FancyZonesEditorIO.ParseParams();
|
||||
if (!parseResult.Result)
|
||||
{
|
||||
FancyZonesEditorIO.ParseCommandLineArguments();
|
||||
Logger.LogError(ParsingErrorReportTag + ": " + parseResult.Message + "; " + ParsingErrorDataTag + ": " + parseResult.MalformedData);
|
||||
MessageBox.Show(parseResult.Message, FancyZonesEditor.Properties.Resources.Error_Parsing_Data_Title, MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
var parseResult = FancyZonesEditorIO.ParseAppliedLayouts();
|
||||
parseResult = FancyZonesEditorIO.ParseAppliedLayouts();
|
||||
if (!parseResult.Result)
|
||||
{
|
||||
Logger.LogError(ParsingErrorReportTag + ": " + parseResult.Message + "; " + ParsingErrorDataTag + ": " + parseResult.MalformedData);
|
||||
|
||||
@@ -83,6 +83,8 @@ namespace FancyZonesEditor
|
||||
Preview.Width = workArea.Width;
|
||||
Preview.Height = workArea.Height;
|
||||
|
||||
_model.ScaleLayout(workAreaWidth: workArea.Width, workAreaHeight: workArea.Height);
|
||||
|
||||
UIElementCollection previewChildren = Preview.Children;
|
||||
int previewChildrenCount = previewChildren.Count;
|
||||
while (previewChildrenCount < _model.Zones.Count)
|
||||
|
||||
@@ -263,11 +263,8 @@ namespace FancyZonesEditor
|
||||
|
||||
private void RenderCanvasPreview(CanvasLayoutModel canvas)
|
||||
{
|
||||
var workArea = canvas.CanvasRect;
|
||||
if (workArea.Width == 0 || workArea.Height == 0)
|
||||
{
|
||||
workArea = App.Overlay.WorkArea;
|
||||
}
|
||||
var screenWorkArea = App.Overlay.WorkArea;
|
||||
canvas.ScaleLayout(workAreaWidth: screenWorkArea.Width, workAreaHeight: screenWorkArea.Height);
|
||||
|
||||
Viewbox viewbox = new Viewbox
|
||||
{
|
||||
@@ -276,8 +273,8 @@ namespace FancyZonesEditor
|
||||
Body.Children.Add(viewbox);
|
||||
Canvas frame = new Canvas
|
||||
{
|
||||
Width = workArea.Width,
|
||||
Height = workArea.Height,
|
||||
Width = screenWorkArea.Width,
|
||||
Height = screenWorkArea.Height,
|
||||
};
|
||||
viewbox.Child = frame;
|
||||
|
||||
|
||||
@@ -111,7 +111,13 @@
|
||||
FontWeight="SemiBold"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0.6"
|
||||
Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}}" />
|
||||
<TextBlock Name="ScalingText"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="{Binding Scaling}"
|
||||
Margin="0,0,0,0"
|
||||
FontSize="8"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentPresenter}}}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace FancyZonesEditor.Utils
|
||||
{
|
||||
public string MonitorName { get; set; }
|
||||
|
||||
public string VirtualDesktopId { get; set; }
|
||||
public Size MonitorSize { get; set; }
|
||||
|
||||
public Rect UnscaledBounds { get; private set; }
|
||||
public string VirtualDesktopId { get; set; }
|
||||
|
||||
public Rect ScaledBounds { get; private set; }
|
||||
|
||||
@@ -23,35 +23,24 @@ namespace FancyZonesEditor.Utils
|
||||
|
||||
public int Dpi { get; set; }
|
||||
|
||||
public Device(string monitorName, string virtualDesktopId, int dpi, Rect bounds, Rect workArea)
|
||||
public Device(string monitorName, string virtualDesktopId, int dpi, Rect workArea, Size monitorSize)
|
||||
{
|
||||
MonitorName = monitorName;
|
||||
VirtualDesktopId = virtualDesktopId;
|
||||
Dpi = dpi;
|
||||
WorkAreaRect = workArea;
|
||||
UnscaledBounds = bounds;
|
||||
ScaledBounds = bounds;
|
||||
MonitorSize = monitorSize;
|
||||
}
|
||||
|
||||
public Device(Rect bounds, Rect workArea)
|
||||
public Device(Rect workArea, Size monitorSize)
|
||||
{
|
||||
WorkAreaRect = workArea;
|
||||
UnscaledBounds = bounds;
|
||||
ScaledBounds = bounds;
|
||||
MonitorSize = monitorSize;
|
||||
}
|
||||
|
||||
public void Scale(double scaleFactor)
|
||||
{
|
||||
WorkAreaRect = new Rect(Math.Round(WorkAreaRect.X * scaleFactor), Math.Round(WorkAreaRect.Y * scaleFactor), Math.Round(WorkAreaRect.Width * scaleFactor), Math.Round(WorkAreaRect.Height * scaleFactor));
|
||||
ScaledBounds = new Rect(Math.Round(ScaledBounds.X * scaleFactor), Math.Round(ScaledBounds.Y * scaleFactor), Math.Round(ScaledBounds.Width * scaleFactor), Math.Round(ScaledBounds.Height * scaleFactor));
|
||||
}
|
||||
|
||||
public double ScaleCoordinate(double coordinate)
|
||||
{
|
||||
float dpi = Dpi != 0 ? Dpi : 96f;
|
||||
double scaleFactor = 96f / dpi;
|
||||
|
||||
return Math.Round(coordinate * scaleFactor);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
@@ -62,13 +51,11 @@ namespace FancyZonesEditor.Utils
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "Virtual desktop: {0}{1}", VirtualDesktopId, Environment.NewLine);
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "DPI: {0}{1}", Dpi, Environment.NewLine);
|
||||
|
||||
string monitorSize = MonitorSize.ToString(CultureInfo.InvariantCulture);
|
||||
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);
|
||||
string scaledBounds = string.Format(CultureInfo.InvariantCulture, "({0}, {1}, {2}, {3})", ScaledBounds.X, ScaledBounds.Y, ScaledBounds.Width, ScaledBounds.Height);
|
||||
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "Monitor size: {0}{1}", monitorSize, Environment.NewLine);
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "Work area: {0}{1}", workArea, Environment.NewLine);
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "Unscaled bounds: {0}{1}", bounds, Environment.NewLine);
|
||||
sb.AppendFormat(CultureInfo.InvariantCulture, "Scaled bounds: {0}{1}", scaledBounds, Environment.NewLine);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@ namespace FancyZonesEditor.Models
|
||||
|
||||
public Device Device { get; set; }
|
||||
|
||||
public Monitor(Rect bounds, Rect workArea)
|
||||
public Monitor(Rect workArea, Size monitorSize)
|
||||
{
|
||||
Window = new LayoutOverlayWindow();
|
||||
Settings = new LayoutSettings();
|
||||
Device = new Device(bounds, workArea);
|
||||
Device = new Device(workArea, monitorSize);
|
||||
|
||||
if (App.DebugMode)
|
||||
{
|
||||
@@ -41,10 +41,10 @@ namespace FancyZonesEditor.Models
|
||||
Window.Height = workArea.Height;
|
||||
}
|
||||
|
||||
public Monitor(string monitorName, string virtualDesktop, int dpi, Rect bounds, Rect workArea)
|
||||
: this(bounds, workArea)
|
||||
public Monitor(string monitorName, string virtualDesktop, int dpi, Rect workArea, Size monitorSize)
|
||||
: this(workArea, monitorSize)
|
||||
{
|
||||
Device = new Device(monitorName, virtualDesktop, dpi, bounds, workArea);
|
||||
Device = new Device(monitorName, virtualDesktop, dpi, workArea, monitorSize);
|
||||
}
|
||||
|
||||
public void Scale(double scaleFactor)
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using FancyZonesEditor.ViewModels;
|
||||
|
||||
namespace FancyZonesEditor.Utils
|
||||
@@ -17,6 +19,7 @@ namespace FancyZonesEditor.Utils
|
||||
ScreenBoundsHeight = height;
|
||||
ScreenBoundsWidth = width;
|
||||
DPI = dpi;
|
||||
Scaling = string.Format(CultureInfo.InvariantCulture, format: "{0}%", arg0: (int)Math.Round(dpi * 100 / 96.0));
|
||||
Selected = selected;
|
||||
}
|
||||
|
||||
@@ -44,6 +47,8 @@ namespace FancyZonesEditor.Utils
|
||||
|
||||
public int DPI { get; set; }
|
||||
|
||||
public string Scaling { get; set; }
|
||||
|
||||
public string Dimensions
|
||||
{
|
||||
get
|
||||
|
||||
@@ -85,9 +85,13 @@ namespace FancyZonesEditor.Utils
|
||||
|
||||
public int TopCoordinate { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
public int WorkAreaWidth { get; set; }
|
||||
|
||||
public int Height { get; set; }
|
||||
public int WorkAreaHeight { get; set; }
|
||||
|
||||
public int MonitorWidth { get; set; }
|
||||
|
||||
public int MonitorHeight { get; set; }
|
||||
|
||||
public bool IsSelected { get; set; }
|
||||
|
||||
@@ -108,6 +112,11 @@ namespace FancyZonesEditor.Utils
|
||||
sb.Append("Y: ");
|
||||
sb.AppendLine(TopCoordinate.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
sb.Append("Width: ");
|
||||
sb.AppendLine(MonitorWidth.ToString(CultureInfo.InvariantCulture));
|
||||
sb.Append("Height: ");
|
||||
sb.AppendLine(MonitorHeight.ToString(CultureInfo.InvariantCulture));
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
@@ -278,179 +287,6 @@ namespace FancyZonesEditor.Utils
|
||||
FancyZonesEditorParamsFile = localAppDataDir + ParamsFile;
|
||||
}
|
||||
|
||||
// All strings in this function shouldn't be localized.
|
||||
public static void ParseCommandLineArguments()
|
||||
{
|
||||
Logger.LogTrace();
|
||||
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
|
||||
if (args.Length < 2 && !App.DebugMode)
|
||||
{
|
||||
MessageBox.Show(Properties.Resources.Error_Not_Standalone_App, Properties.Resources.Error_Message_Box_Title);
|
||||
((App)Application.Current).Shutdown();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
/*
|
||||
* Divider: /
|
||||
* Parts:
|
||||
* (1) Process id
|
||||
* (2) Span zones across monitors
|
||||
* (3) Monitor id where the Editor should be opened
|
||||
* (4) Monitors count
|
||||
*
|
||||
* Data for each monitor:
|
||||
* (5) Monitor id
|
||||
* (6) DPI
|
||||
* (7) work area left
|
||||
* (8) work area top
|
||||
* (9) work area width
|
||||
* (10) work area height
|
||||
* ...
|
||||
* Using CultureInfo.InvariantCulture since this is us parsing our own data
|
||||
*/
|
||||
var argsParts = args[1].Split('/');
|
||||
|
||||
// Process ID
|
||||
App.PowerToysPID = int.Parse(argsParts[(int)CmdArgs.PowerToysPID], CultureInfo.InvariantCulture);
|
||||
|
||||
// Span zones across monitors
|
||||
App.Overlay.SpanZonesAcrossMonitors = int.Parse(argsParts[(int)CmdArgs.SpanZones], CultureInfo.InvariantCulture) == 1;
|
||||
|
||||
// Target monitor id
|
||||
string targetMonitorName = argsParts[(int)CmdArgs.TargetMonitorId];
|
||||
|
||||
if (!App.Overlay.SpanZonesAcrossMonitors)
|
||||
{
|
||||
// Test launch with custom monitors configuration
|
||||
bool isCustomMonitorConfigurationMode = targetMonitorName.StartsWith("Monitor#", StringComparison.Ordinal);
|
||||
if (isCustomMonitorConfigurationMode)
|
||||
{
|
||||
App.Overlay.Monitors.Clear();
|
||||
}
|
||||
|
||||
// Monitors count
|
||||
int count = int.Parse(argsParts[(int)CmdArgs.MonitorsCount], CultureInfo.InvariantCulture);
|
||||
|
||||
// Parse the native monitor data
|
||||
List<NativeMonitorData> nativeMonitorData = new List<NativeMonitorData>();
|
||||
const int monitorArgsCount = 6;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var nativeData = default(NativeMonitorData);
|
||||
nativeData.Monitor = argsParts[(int)CmdArgs.MonitorId + (i * monitorArgsCount)];
|
||||
nativeData.Dpi = int.Parse(argsParts[(int)CmdArgs.DPI + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.LeftCoordinate = int.Parse(argsParts[(int)CmdArgs.MonitorLeft + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.TopCoordinate = int.Parse(argsParts[(int)CmdArgs.MonitorTop + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.Width = int.Parse(argsParts[(int)CmdArgs.MonitorWidth + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.Height = int.Parse(argsParts[(int)CmdArgs.MonitorHeight + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
|
||||
nativeMonitorData.Add(nativeData);
|
||||
}
|
||||
|
||||
var monitors = App.Overlay.Monitors;
|
||||
|
||||
// Update monitors data
|
||||
if (isCustomMonitorConfigurationMode)
|
||||
{
|
||||
foreach (NativeMonitorData nativeData in nativeMonitorData)
|
||||
{
|
||||
var splittedId = nativeData.Monitor.Split('_');
|
||||
|
||||
Rect bounds = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.Width, nativeData.Height);
|
||||
|
||||
Monitor monitor = new Monitor(bounds, bounds);
|
||||
monitor.Device.MonitorName = nativeData.Monitor.Substring(0, nativeData.Monitor.LastIndexOf("_", StringComparison.Ordinal));
|
||||
monitor.Device.VirtualDesktopId = nativeData.Monitor.Substring(nativeData.Monitor.LastIndexOf("_", StringComparison.Ordinal) + 1);
|
||||
monitor.Device.Dpi = nativeData.Dpi;
|
||||
|
||||
monitors.Add(monitor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (NativeMonitorData nativeData in nativeMonitorData)
|
||||
{
|
||||
Rect workArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.Width, nativeData.Height);
|
||||
if (nativeData.IsSelected)
|
||||
{
|
||||
targetMonitorName = nativeData.Monitor;
|
||||
}
|
||||
|
||||
var monitor = new Monitor(workArea, workArea);
|
||||
monitor.Device.MonitorName = nativeData.Monitor.Substring(0, nativeData.Monitor.LastIndexOf("_", StringComparison.Ordinal));
|
||||
monitor.Device.VirtualDesktopId = nativeData.Monitor.Substring(nativeData.Monitor.LastIndexOf("_", StringComparison.Ordinal) + 1);
|
||||
monitor.Device.Dpi = nativeData.Dpi;
|
||||
|
||||
App.Overlay.AddMonitor(monitor);
|
||||
}
|
||||
}
|
||||
|
||||
// Set active desktop
|
||||
for (int i = 0; i < monitors.Count; i++)
|
||||
{
|
||||
var monitor = monitors[i];
|
||||
|
||||
var monitorName = targetMonitorName.Substring(0, targetMonitorName.LastIndexOf("_", StringComparison.Ordinal));
|
||||
var virtualDesktop = targetMonitorName.Substring(targetMonitorName.LastIndexOf("_", StringComparison.Ordinal) + 1);
|
||||
|
||||
if (monitor.Device.MonitorName == monitorName && monitor.Device.VirtualDesktopId == virtualDesktop)
|
||||
{
|
||||
App.Overlay.CurrentDesktop = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Monitors count
|
||||
int count = int.Parse(argsParts[(int)CmdArgs.MonitorsCount], CultureInfo.InvariantCulture);
|
||||
|
||||
// Parse the native monitor data
|
||||
List<NativeMonitorData> nativeMonitorData = new List<NativeMonitorData>();
|
||||
const int monitorArgsCount = 6;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var nativeData = default(NativeMonitorData);
|
||||
nativeData.Monitor = argsParts[(int)CmdArgs.MonitorId + (i * monitorArgsCount)];
|
||||
nativeData.Dpi = int.Parse(argsParts[(int)CmdArgs.DPI + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.LeftCoordinate = int.Parse(argsParts[(int)CmdArgs.MonitorLeft + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.TopCoordinate = int.Parse(argsParts[(int)CmdArgs.MonitorTop + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.Width = int.Parse(argsParts[(int)CmdArgs.MonitorWidth + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
nativeData.Height = int.Parse(argsParts[(int)CmdArgs.MonitorHeight + (i * monitorArgsCount)], CultureInfo.InvariantCulture);
|
||||
|
||||
nativeMonitorData.Add(nativeData);
|
||||
}
|
||||
|
||||
Rect workAreaUnion = default;
|
||||
|
||||
// Update monitors data
|
||||
foreach (NativeMonitorData nativeData in nativeMonitorData)
|
||||
{
|
||||
Rect workArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.Width, nativeData.Height);
|
||||
workAreaUnion = Rect.Union(workAreaUnion, workArea);
|
||||
}
|
||||
|
||||
var monitor = new Monitor(workAreaUnion, workAreaUnion);
|
||||
|
||||
var monitorName = targetMonitorName.Substring(0, targetMonitorName.LastIndexOf("_", StringComparison.Ordinal));
|
||||
var virtualDesktop = targetMonitorName.Substring(targetMonitorName.LastIndexOf("_", StringComparison.Ordinal) + 1);
|
||||
monitor.Device.MonitorName = monitorName;
|
||||
monitor.Device.VirtualDesktopId = virtualDesktop;
|
||||
|
||||
App.Overlay.Monitors.Add(monitor);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError("Invalid command line arguments: " + args[1], ex);
|
||||
MessageBox.Show(Properties.Resources.Error_Invalid_Arguments, Properties.Resources.Error_Message_Box_Title);
|
||||
((App)Application.Current).Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
public ParsingResult ParseParams()
|
||||
{
|
||||
Logger.LogTrace();
|
||||
@@ -477,14 +313,16 @@ namespace FancyZonesEditor.Utils
|
||||
|
||||
foreach (NativeMonitorData nativeData in editorParams.Monitors)
|
||||
{
|
||||
Rect workArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.Width, nativeData.Height);
|
||||
Rect workArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.WorkAreaWidth, nativeData.WorkAreaHeight);
|
||||
if (nativeData.IsSelected)
|
||||
{
|
||||
targetMonitorId = nativeData.Monitor;
|
||||
targetVirtualDesktop = nativeData.VirtualDesktop;
|
||||
}
|
||||
|
||||
var monitor = new Monitor(workArea, workArea);
|
||||
Size monitorSize = new Size(nativeData.MonitorWidth, nativeData.MonitorHeight);
|
||||
|
||||
var monitor = new Monitor(workArea, monitorSize);
|
||||
monitor.Device.MonitorName = nativeData.Monitor;
|
||||
monitor.Device.VirtualDesktopId = nativeData.VirtualDesktop;
|
||||
monitor.Device.Dpi = nativeData.Dpi;
|
||||
@@ -512,9 +350,10 @@ namespace FancyZonesEditor.Utils
|
||||
}
|
||||
|
||||
var nativeData = editorParams.Monitors[0];
|
||||
Rect workArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.Width, nativeData.Height);
|
||||
Rect workArea = new Rect(nativeData.LeftCoordinate, nativeData.TopCoordinate, nativeData.WorkAreaWidth, nativeData.WorkAreaHeight);
|
||||
Size monitorSize = new Size(nativeData.MonitorWidth, nativeData.MonitorHeight);
|
||||
|
||||
var monitor = new Monitor(workArea, workArea);
|
||||
var monitor = new Monitor(workArea, monitorSize);
|
||||
monitor.Device.MonitorName = nativeData.Monitor;
|
||||
monitor.Device.VirtualDesktopId = nativeData.VirtualDesktop;
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ namespace FancyZonesEditor.ViewModels
|
||||
foreach (var monitor in App.Overlay.Monitors)
|
||||
{
|
||||
Device device = monitor.Device;
|
||||
var bounds = device.ScaledBounds;
|
||||
maxDimension = System.Math.Max(System.Math.Max(maxDimension, bounds.Height), bounds.Width);
|
||||
minDimension = System.Math.Min(System.Math.Min(minDimension, bounds.Height), bounds.Width);
|
||||
var size = device.MonitorSize;
|
||||
maxDimension = System.Math.Max(System.Math.Max(maxDimension, size.Height), size.Width);
|
||||
minDimension = System.Math.Min(System.Math.Min(minDimension, size.Height), size.Width);
|
||||
|
||||
MonitorInfoForViewModel.Add(new MonitorInfoModel(i, (int)bounds.Height, (int)bounds.Width, device.Dpi, App.Overlay.CurrentDesktop == i - 1));
|
||||
MonitorInfoForViewModel.Add(new MonitorInfoModel(i, (int)size.Height, (int)size.Width, device.Dpi, App.Overlay.CurrentDesktop == i - 1));
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user