-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathlayout_layer.v
More file actions
38 lines (32 loc) · 895 Bytes
/
layout_layer.v
File metadata and controls
38 lines (32 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module ui
const id_append_top_layer = '___ON_TOP_LAYER___'
// CanvasLayout as Layer
// Used to absolute coordinates on top (of everything)
pub fn canvas_layer(c CanvasLayoutParams) &CanvasLayout {
mut cl := canvas_layout(c)
cl.is_root_layout = false
cl.id = 'top_layer'
cl.z_index = -1
cl.clipping = false
cl.active_evt_mngr = false
cl.is_canvas_layer = true
cl.update_style_params(bg_color: transparent)
// println('canvas_layer $cl.id')
return cl
}
pub fn (mut c CanvasLayout) add_top_layer(w Widget) {
if c.is_canvas_layer {
c.children << w
c.drawing_children << w
}
}
pub fn (mut window Window) add_top_layer(w Widget) {
window.top_layer.add_top_layer(w)
}
// init for top layer
fn (mut window Window) init_top_layer() {
window.top_layer.init(window)
window.top_layer.width = window.width
window.top_layer.height = window.height
window.top_layer.update_layout()
}