nixos-configs/devices/wim/config/ags/js/bar/buttons/osk-toggle.js

21 lines
495 B
JavaScript
Raw Normal View History

2023-12-18 18:00:30 -05:00
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
2023-09-04 22:27:34 -04:00
import Tablet from '../../../services/tablet.js';
2023-11-16 00:48:50 -05:00
import EventBox from '../../misc/cursorbox.js';
2023-09-04 22:47:12 -04:00
export default () => EventBox({
className: 'toggle-off',
onPrimaryClickRelease: () => Tablet.toggleOsk(),
2023-12-18 18:00:30 -05:00
child: Label({
class_name: 'osk-toggle',
xalign: 0.6,
label: '󰌌 ',
}),
2023-12-18 18:00:30 -05:00
}).hook(Tablet, (self) => {
self.toggleClassName('toggle-on', Tablet.oskState);
}, 'osk-toggled');