-
Notifications
You must be signed in to change notification settings - Fork 7
/
gpaste_merge_panel.js
127 lines (111 loc) · 3.25 KB
/
gpaste_merge_panel.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const St = imports.gi.St;
const Lang = imports.lang;
const GPasteMergePanel = new Lang.Class({
Name: 'GPasteMergePanel',
_init: function() {
this.actor = new St.BoxLayout({
vertical: false,
visible: false
});
this._merge_button = new St.Button({
label: ' Merge ',
style_class: 'gpaste-button'
});
let decorator_label = new St.Label({
text: 'decorator '
});
this._decorator_entry = new St.Entry({
width: 50,
style: 'font-size: 12px'
});
let separator_label = new St.Label({
text: ' separator '
});
this._separator_entry = new St.Entry({
width: 50,
style: 'font-size: 12px;'
});
this.merge_box = new St.BoxLayout({
vertical: false,
style: 'padding-top: 10px;'
});
this.merge_box.add_child(decorator_label);
this.merge_box.add_child(this._decorator_entry);
this.merge_box.add_child(separator_label);
this.merge_box.add_child(this._separator_entry);
this.merge_box.add_child(this._merge_button);
this._merge_count_label = new St.Label();
let reset_icon = new St.Icon({
icon_name: 'edit-delete-symbolic',
icon_size: 20
});
this.reset_button = new St.Button({
child: reset_icon,
style_class: 'gpaste-button'
});
let delete_icon = new St.Icon({
icon_name: 'user-trash-symbolic',
icon_size: 20
});
this.delete_button = new St.Button({
child: delete_icon,
style_class: 'gpaste-button',
style: 'padding-left: 5px;'
});
this.actor.add(this.reset_button, {
x_expand: false,
x_fill: false,
x_align: St.Align.START,
y_expand: false,
y_fill: false,
y_align: St.Align.MIDDLE
});
this.actor.add(this._merge_count_label, {
x_expand: false,
x_fill: false,
x_align: St.Align.START,
y_expand: false,
y_fill: false,
y_align: St.Align.MIDDLE
});
this.actor.add(this.delete_button, {
x_expand: false,
x_fill: false,
x_align: St.Align.START,
y_expand: false,
y_fill: false,
y_align: St.Align.MIDDLE
});
this.actor.add(this.merge_box, {
expand: true,
x_fill: false,
x_align: St.Align.END,
y_fill: false,
y_align: St.Align.MIDDLE
});
},
set_label: function(text) {
this._merge_count_label.set_text(text);
},
show: function() {
this.actor.show();
},
hide: function() {
this.actor.hide();
},
get decorator_entry() {
return this._decorator_entry;
},
get separator_entry() {
return this._separator_entry;
},
get decorator() {
return this._decorator_entry.get_text();
},
get separator() {
return this._separator_entry.get_text();
},
get button() {
return this._merge_button;
}
});