-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcompat.js
56 lines (47 loc) · 1003 Bytes
/
compat.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
const { Clutter, GObject } = imports.gi;
const PopupMenu = imports.ui.popupMenu;
const Config = imports.misc.config;
var IS_OLD_SHELL = (Config.PACKAGE_VERSION.split('.')[1] < 35);
var AltPopupBase = GObject.registerClass(
class AltPopupBase extends PopupMenu.PopupBaseMenuItem
{
_init()
{
super._init({ hover: false });
}
add_style_pseudo_class()
{
return null;
}
_onButtonReleaseEvent(actor, event)
{
return this.vfunc_button_release_event();
}
vfunc_button_release_event()
{
return Clutter.EVENT_STOP;
}
});
var AltPopupImage = GObject.registerClass(
class AltPopupImage extends PopupMenu.PopupImageMenuItem
{
_init(text, icon)
{
super._init(text, icon);
}
/* Default temporary action for override */
_onItemClicked()
{
return null;
}
_onButtonReleaseEvent(actor, event)
{
return this.vfunc_button_release_event();
}
vfunc_button_release_event()
{
this.remove_style_pseudo_class('active');
this._onItemClicked();
return Clutter.EVENT_STOP;
}
});