diff --git a/src/cg/os.cg b/src/cg/os.cg index a674338..7405162 100644 --- a/src/cg/os.cg +++ b/src/cg/os.cg @@ -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;