Skip to content

Commit

Permalink
Make tray's Align All start from top-left.
Browse files Browse the repository at this point in the history
  • Loading branch information
menees committed Jun 3, 2023
1 parent 736e144 commit 69cd6a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<_SkipUpgradeNetAnalyzersNuGetWarning >true</_SkipUpgradeNetAnalyzersNuGetWarning>

<!-- Make the assembly, file, and NuGet package versions the same. -->
<Version>1.2.0</Version>
<Version>1.2.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
5 changes: 2 additions & 3 deletions src/GizmoTray/TrayManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ private static void AlignAll(object? sender, EventArgs e)
if (windowInfo.Count > 0)
{
windowInfo = windowInfo.OrderBy(rect => rect.Top).ThenBy(rect => rect.Left).ToList();
double minLleft = windowInfo.Min(rect => rect.Left);
double nextTop = windowInfo.Min(rect => rect.Top);
(_, double left, double nextTop, _) = windowInfo[0];
foreach ((string baseName, _, _, double height) in windowInfo)
{
Remote.TryCallService<IGizmoServer>(baseName, server => server.MoveTo(minLleft, nextTop));
Remote.TryCallService<IGizmoServer>(baseName, server => server.MoveTo(left, nextTop));

const double Separator = 2;
nextTop += height + Separator;
Expand Down

0 comments on commit 69cd6a8

Please sign in to comment.