feat: implement plugin market installation service and associated infrastructure for desktop widgets and window management

This commit is contained in:
lincube
2026-07-14 11:40:12 +09:00
parent 611d03b828
commit 5f684ce8b6
14 changed files with 2952 additions and 414 deletions

View File

@@ -0,0 +1,57 @@
using Avalonia;
using LanMountainDesktop.Services;
using Xunit;
namespace LanMountainDesktop.Tests;
public sealed class FusedDesktopScreenTopologyTests
{
[Fact]
public void RemovedMonitorPositionMovesToNearestRemainingWorkingArea()
{
var screens = new[]
{
new FusedDesktopScreenWorkArea(new PixelRect(0, 0, 1920, 1040), 1d)
};
var result = FusedDesktopManagerService.CoerceToValidWorkingArea(
new PixelPoint(-2600, 200),
new Size(300, 180),
screens);
Assert.Equal(new PixelPoint(0, 200), result);
}
[Fact]
public void HighDpiWorkingAreaKeepsEntireWidgetVisible()
{
var screens = new[]
{
new FusedDesktopScreenWorkArea(new PixelRect(0, 0, 1920, 1040), 2d)
};
var result = FusedDesktopManagerService.CoerceToValidWorkingArea(
new PixelPoint(1800, 980),
new Size(200, 120),
screens);
Assert.Equal(new PixelPoint(1520, 800), result);
}
[Fact]
public void NegativeCoordinateMonitorUsesItsOwnWorkAreaAndScaling()
{
var screens = new[]
{
new FusedDesktopScreenWorkArea(new PixelRect(-1920, 0, 1920, 1080), 1d),
new FusedDesktopScreenWorkArea(new PixelRect(0, 0, 2560, 1400), 1.5d)
};
var result = FusedDesktopManagerService.CoerceToValidWorkingArea(
new PixelPoint(-100, 1000),
new Size(200, 200),
screens);
Assert.Equal(new PixelPoint(-200, 880), result);
}
}