2023-10-31 08:32:40 -04:00
|
|
|
import App from 'resource:///com/github/Aylur/ags/app.js';
|
|
|
|
import { CenterBox, EventBox } from 'resource:///com/github/Aylur/ags/widget.js';
|
2023-10-02 12:06:35 -04:00
|
|
|
|
|
|
|
import Gtk from 'gi://Gtk';
|
|
|
|
|
2023-09-18 16:14:11 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default ({
|
2023-10-20 23:11:21 -04:00
|
|
|
child,
|
|
|
|
...props
|
2023-09-18 16:14:11 -04:00
|
|
|
}) => {
|
2023-10-20 23:11:21 -04:00
|
|
|
const widget = EventBox({
|
|
|
|
...props,
|
|
|
|
});
|
2023-09-18 16:14:11 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
const gesture = Gtk.GestureSwipe.new(widget);
|
2023-09-18 16:14:11 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
widget.add(CenterBox({
|
|
|
|
children: [child],
|
|
|
|
connections: [[gesture, () => {
|
|
|
|
const velocity = gesture.get_velocity()[1];
|
|
|
|
if (velocity < -100)
|
2023-11-01 14:31:55 -04:00
|
|
|
App.openWindow('applauncher');
|
2023-10-20 23:11:21 -04:00
|
|
|
}, 'update']],
|
|
|
|
}));
|
2023-09-18 16:14:11 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
return widget;
|
2023-09-18 16:14:11 -04:00
|
|
|
};
|