This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
actionsItem.js
101 lines (84 loc) · 2.57 KB
/
actionsItem.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
const Gettext = imports.gettext;
const Lang = imports.lang;
const St = imports.gi.St;
const Clutter = imports.gi.Clutter;
const Util = imports.misc.util;
const PopupMenu = imports.ui.popupMenu;
const GObject = imports.gi.GObject;
var InfoBtn = GObject.registerClass(class InfoBtnClass extends St.Button {
_init() {
super._init({
reactive: true,
can_focus: true,
track_hover: true,
style_class: 'system-menu-action'
});
this.child = new St.Icon({
icon_name: 'dialog-information-symbolic'
});
}
});
var ClearBtn = GObject.registerClass(class ClearBtnClass extends St.Button {
_init() {
super._init({
reactive: true,
can_focus: true,
track_hover: true,
style_class: 'system-menu-action'
});
this.child = new St.Icon({
icon_name: 'edit-clear-all-symbolic'
});
}
});
var PrefsBtn = GObject.registerClass(class PrefsBtnClass extends St.Button {
_init() {
super._init({
reactive: true,
can_focus: true,
track_hover: true,
style_class: 'system-menu-action'
});
this.child = new St.Icon({
icon_name: 'preferences-system-symbolic'
});
}
});
var ClearBtnItem = GObject.registerClass(class ClearBtnItemClass extends St.BoxLayout {
_init() {
super._init({ style_class: 'popup-menu-item' });
let _icon = new St.Icon({
icon_name: 'edit-clear-all-symbolic',
style_class: 'popup-menu-icon'
});
let _label = new St.Label({
text: _('Clear All'),
y_expand: true,
y_align: Clutter.ActorAlign.CENTER
});
this.add_child(_icon);
this.add_child(_label);
}
});
var ActionsItem = GObject.registerClass(class ActionsItemClass extends PopupMenu.PopupBaseMenuItem {
_init(recentManager) {
super._init({
reactive: false,
can_focus: false
});
let _prefs = new PrefsBtn({
x_expand: true,
x_fill: false
});
_prefs.connect('clicked', function() {
Util.spawn(['gnome-shell-extension-prefs', '[email protected]']);
});
let _clear = new ClearBtn({
x_expand: true,
x_fill: false
});
_clear.connect('clicked', recentManager.clearAll.bind(recentManager));
this.actor.add_child(_prefs);
this.actor.add_child(_clear);
}
});