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-09-18 16:14:11 -04:00
|
|
|
child,
|
2023-10-17 13:47:02 -04:00
|
|
|
...props
|
2023-09-18 16:14:11 -04:00
|
|
|
}) => {
|
2023-10-17 13:47:02 -04:00
|
|
|
let widget = EventBox({
|
|
|
|
...props,
|
2023-09-18 16:14:11 -04:00
|
|
|
});
|
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
let gesture = Gtk.GestureSwipe.new(widget);
|
2023-09-18 16:14:11 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
widget.child = CenterBox({
|
|
|
|
children: [ child ],
|
|
|
|
connections: [[gesture, () => {
|
|
|
|
const velocity = gesture.get_velocity()[1];
|
|
|
|
if (velocity < -100)
|
|
|
|
App.openWindow('quick-settings');
|
2023-09-18 16:14:11 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
}, 'update']],
|
2023-09-18 16:14:11 -04:00
|
|
|
});
|
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
return widget;
|
2023-09-18 16:14:11 -04:00
|
|
|
};
|