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
|
|
|
|
|
|
|
export const Gesture = ({
|
|
|
|
child,
|
|
|
|
...params
|
|
|
|
}) => {
|
|
|
|
let w = EventBox({
|
|
|
|
...params,
|
|
|
|
});
|
|
|
|
|
|
|
|
let gesture = Gtk.GestureSwipe.new(w);
|
|
|
|
|
|
|
|
w.child = CenterBox({
|
|
|
|
children: [
|
|
|
|
child,
|
|
|
|
],
|
|
|
|
connections: [
|
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
[gesture, _ => {
|
2023-09-18 16:14:11 -04:00
|
|
|
const velocity = gesture.get_velocity()[1];
|
2023-09-19 09:36:39 -04:00
|
|
|
if (velocity < -100)
|
2023-10-14 13:54:45 -04:00
|
|
|
App.openWindow('quick-settings');
|
2023-09-18 16:14:11 -04:00
|
|
|
}, 'update'],
|
|
|
|
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
return w;
|
|
|
|
};
|