Layout: review r1 fixes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 12:32:10 -04:00
1 parent 2a232930dd
commit a8412f4f9c
22 files changed
+381 -99

No files matched your search

+18
View File
@@ -80,3 +80,21 @@ func TestTitleBarSnapshot(t *testing.T) {
})
})
}
func TestTitleBarTextScale(t *testing.T) {
var bar ui.Rect
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
bar = TitleBar(c, "Archive", TitleBarOptions{}).Bounds()
}, 400, 300)
plain, _ := tt.Find("Archive")
tt.SetPreferences(ui.Preferences{TextScale: 2})
tt.Frame()
big, _ := tt.Find("Archive")
if big.H < 1.8*plain.H {
t.Fatalf("title height %v at 200%%, was %v", big.H, plain.H)
}
if bar.H < big.H {
t.Fatalf("bar %v shorter than its title %v", bar.H, big.H)
}
}