feat: add portable Windows zone manager

This commit is contained in:
Steve Cliff
2026-08-20 08:57:41 +01:00
parent 318300ef79
commit 6ddecad74d
15 changed files with 1760 additions and 4 deletions
+21
View File
@@ -0,0 +1,21 @@
package layout
import (
"github.com/stevec/fancywin/internal/config"
"testing"
)
func TestResolvePercentageAndGap(t *testing.T) {
got := Resolve(Rect{0, 0, 1920, 1040}, config.Zone{X: 50, Y: 0, Width: 50, Height: 100}, 8)
want := (Rect{968, 8, 1912, 1032})
if got != want {
t.Fatalf("got %+v, want %+v", got, want)
}
}
func TestZoneAt(t *testing.T) {
z := []config.Zone{{X: 0, Y: 0, Width: 50, Height: 100}, {X: 50, Y: 0, Width: 50, Height: 100}}
if got := ZoneAt(Rect{0, 0, 100, 100}, z, 0, Point{75, 20}); got != 1 {
t.Fatalf("got %d", got)
}
}