tweaking os
This commit is contained in:
parent
b04be8ccab
commit
3886228f4a
1 changed files with 17 additions and 8 deletions
25
src/cg/os.cg
25
src/cg/os.cg
|
|
@ -124,7 +124,11 @@ renderWindow = window isActive \
|
||||||
ui.positioned {
|
ui.positioned {
|
||||||
x = 8,
|
x = 8,
|
||||||
y = 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,
|
w = windowWidth window,
|
||||||
h = viewport.height - titleBarHeight,
|
h = viewport.height - titleBarHeight,
|
||||||
child = eval! window.appExpr
|
child = eval! window.appExpr
|
||||||
| (Value app) \ (hasField "view" app
|
| (Value v) \ (ctx = {
|
||||||
| True \ app.view {
|
|
||||||
w = windowWidth window,
|
w = windowWidth window,
|
||||||
h = viewport.height - titleBarHeight,
|
h = viewport.height - titleBarHeight,
|
||||||
openApp = openOrFocus,
|
openApp = openOrFocus,
|
||||||
close = _ \ closeWindowById window.id
|
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
|
| (Err msg) \ text msg
|
||||||
| _ \ text "App not found"
|
| _ \ text "App not found"
|
||||||
}
|
}
|
||||||
|
|
@ -203,9 +210,11 @@ onSelect = input \
|
||||||
| True \ openOrFocus input input (hasField "width" v
|
| True \ openOrFocus input input (hasField "width" v
|
||||||
| True \ v.width
|
| True \ v.width
|
||||||
| False \ dw)
|
| False \ dw)
|
||||||
| False \ (hasField "_tag" v
|
| False \ (isFunction v
|
||||||
| True \ batch [historyEvent, v]
|
| True \ openOrFocus input input dw
|
||||||
| False \ openOrFocus input input dw))
|
| False \ (hasField "_tag" v
|
||||||
|
| True \ batch [historyEvent, v]
|
||||||
|
| False \ openOrFocus input input dw)))
|
||||||
| (Err msg) \ (_ = debug! "OS Error" msg;
|
| (Err msg) \ (_ = debug! "OS Error" msg;
|
||||||
noOp)
|
noOp)
|
||||||
| _ \ noOp;
|
| _ \ noOp;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue