tweaking os

This commit is contained in:
Dustin Swan 2026-04-08 20:34:07 -06:00
parent b04be8ccab
commit 3886228f4a
No known key found for this signature in database
GPG key ID: 30D46587E2100467

View file

@ -124,7 +124,11 @@ renderWindow = window isActive \
ui.positioned {
x = 8,
y = 8,
child = renderText { content = window.title, color = "white" }
child = ui.clip {
h = titleBarHeight,
w = ((windowWidth window) - titleBarHeight) - 16,
child = renderText { content = window.title, color = "white" }
}
}
] }
] }
@ -136,14 +140,17 @@ renderWindow = window isActive \
w = windowWidth window,
h = viewport.height - titleBarHeight,
child = eval! window.appExpr
| (Value app) \ (hasField "view" app
| True \ app.view {
| (Value v) \ (ctx = {
w = windowWidth window,
h = viewport.height - titleBarHeight,
openApp = openOrFocus,
close = _ \ closeWindowById window.id
}
| False \ text (display app))
};
hasField "view" v
| True \ v.view ctx
| False \ (isFunction v
| True \ v ctx
| False \ text (display app)))
| (Err msg) \ text msg
| _ \ text "App not found"
}
@ -203,9 +210,11 @@ onSelect = input \
| True \ openOrFocus input input (hasField "width" v
| True \ v.width
| False \ dw)
| False \ (hasField "_tag" v
| True \ batch [historyEvent, v]
| False \ openOrFocus input input dw))
| False \ (isFunction v
| True \ openOrFocus input input dw
| False \ (hasField "_tag" v
| True \ batch [historyEvent, v]
| False \ openOrFocus input input dw)))
| (Err msg) \ (_ = debug! "OS Error" msg;
noOp)
| _ \ noOp;