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
39
40
41
42
43
44
45
46
47
48
49
50
51
|
define.class('$ui/view', function(require, $ui$, view, icon, label, button){
this.attributes = {
title: Config({type:String, value:"Untitled"}),
fontsize: Config({type:float, value:12, meta:"fontsize"}),
icon: Config({type:String})
}
this.padding = 0;
this.margin = 4;
this.borderradius = vec4(10,10,1,1);
this.bgcolor = vec4("red");
this.flex = 1;
this.flexdirection ="column"
this.render = function(){
var docbutton = []
if (this.icon) {
docbutton.push(
button({
icon: this._icon,
buttoncolor1:"transparent",
buttoncolor2:"transparent",
pressedcolor1:"transparent",
pressedcolor2:"transparent",
borderwidth:0,
padding:3,
click: this.click
})
)
}
return [
view({bgcolor:"#585858",borderradius:0, bordercolor:"transparent" , borderwidth:0, margin:0, padding:vec4(0)},
view({margin:vec4(1,1,2,0),bgcolor:"#4e4e4e", borderwidth:0,borderradius:vec4(10,10,1,.1),padding:vec4(10,2,10,2)},
label({font: require('$resources/fonts/opensans_bold_ascii.glf'),margin:3, text:this.title, bgcolor:NaN, fontsize:this.fontsize, fgcolor: "white" }),
docbutton
)
)
,this.constructor_children
];
}
})
|