nixos-configs/hosts/wim/config/ags/js/bar/gesture.js

34 lines
537 B
JavaScript
Raw Normal View History

import { Widget, App } from '../../imports.js';
const { CenterBox, EventBox } = Widget;
import Gtk from 'gi://Gtk';
export const Gesture = ({
child,
...params
}) => {
let w = EventBox({
...params,
});
let gesture = Gtk.GestureSwipe.new(w);
w.child = CenterBox({
children: [
child,
],
connections: [
[gesture, _ => {
const velocity = gesture.get_velocity()[1];
if (velocity < -100)
2023-10-14 13:54:45 -04:00
App.openWindow('quick-settings');
}, 'update'],
],
});
return w;
};