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

23 lines
545 B
JavaScript
Raw Normal View History

import { Box, 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(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.oskState);
}, 'osk-toggled');
},
child: Box({
className: 'osk-toggle',
children: [Label(' 󰌌 ')],
}),
2023-09-04 22:27:34 -04:00
});