2023-10-02 12:06:35 -04:00
|
|
|
import { Widget, App } from '../../imports.js';
|
|
|
|
const { CenterBox, EventBox } = Widget;
|
|
|
|
|
|
|
|
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)
|
|
|
|
App.openWindow('quick-settings');
|
|
|
|
}, '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
|
|
|
};
|