Add managed Window resource and native shell operations
Verify Tessera GUI / verify (push) Failing after 7m25s

This commit is contained in:
2026-10-21 17:12:55 +08:00
parent 3ea4bac48c
commit 76e293d3b8
11 changed files with 681 additions and 41 deletions
+1
View File
@@ -2,6 +2,7 @@
| File | Purpose |
| --- | --- |
| [window.endor](window.endor) | A managed native Window resizes the actual shell; source callbacks update it and layout follows reported dimensions. |
| [layout-cache.endor](layout-cache.endor) | Per-occurrence source measurement caches, separate size/paint models, and a band using the logical viewport input. |
| [source-layout.endor](source-layout.endor) | Source measurement reads its initial Mount parent; source arrangement moves a child and a click updates the shared layout model. |
| [source-hit.endor](source-hit.endor) | Source circle hit testing, ordinary Block click subscriptions and fallback to the parent through transparent space. |
+26
View File
@@ -0,0 +1,26 @@
class WindowActions {
window: Window
function compact(self: WindowActions, event: Event): Unit {
self.window.resize(900, 600)
}
function wide(self: WindowActions, event: Event): Unit {
self.window.resize(1120, 720)
}
}
class WindowBand: RectBlock {
function measure(self: WindowBand, mount: Mount, constraints: Constraints): MeasureResult {
return MeasureResult(constraints.maxWidth, 32)
}
}
window = ui.window()
actions = WindowActions(window)
band = WindowBand(80, 32, 0, "#237A45")
compact = Button("紧凑窗口 900 × 600")
wide = Button("宽窗口 1120 × 720")
compactConnection = compact.on("click", actions.compact)
wideConnection = wide.on("click", actions.wide)
page = Page()
page.render(Column(24, 16, TextBlock("代码与 GUI 操作同一个受管窗口对象"), band, compact, wide))
page.open(window)
window.setTitle("Endor Window")
window.resize(1120, 720)