-
Notifications
You must be signed in to change notification settings - Fork 7
/
item_info_view.js
51 lines (42 loc) · 1.1 KB
/
item_info_view.js
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
const St = imports.gi.St;
const Lang = imports.lang;
const Params = imports.misc.params;
const ItemInfoView = new Lang.Class({
Name: 'ItemInfoView',
_init: function(params) {
this._params = new Params.parse(params, {
box_style_class: '',
label_style_class: ''
});
this._label = new St.Label({
style_class: this._params.label_style_class
});
this.actor = new St.BoxLayout({
style_class: this._params.box_style_class
});
this.actor.add(this._label, {
x_expand: false,
x_fill: false,
x_align: St.Align.MIDDLE,
y_expand: false,
y_fill: false,
y_align: St.Align.MIDDLE
});
this.actor.hide();
},
set_text: function(text) {
this._label.set_text('\u25B6 ' + text);
},
show: function() {
this.actor.show();
},
hide: function() {
this.actor.hide();
},
destroy: function() {
this.actor.destroy();
},
get shown() {
return this.actor.visible;
}
});