tweaking os
This commit is contained in:
parent
b04be8ccab
commit
3886228f4a
1 changed files with 17 additions and 8 deletions
19
src/cg/os.cg
19
src/cg/os.cg
|
|
@ -124,8 +124,12 @@ renderWindow = window isActive \
|
|||
ui.positioned {
|
||||
x = 8,
|
||||
y = 8,
|
||||
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 \ (isFunction v
|
||||
| True \ openOrFocus input input dw
|
||||
| False \ (hasField "_tag" v
|
||||
| True \ batch [historyEvent, v]
|
||||
| False \ openOrFocus input input dw))
|
||||
| False \ openOrFocus input input dw)))
|
||||
| (Err msg) \ (_ = debug! "OS Error" msg;
|
||||
noOp)
|
||||
| _ \ noOp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue