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

24 lines
558 B
JavaScript

import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Tablet from '../../../services/tablet.js';
import CursorBox from '../../misc/cursorbox.js';
export default () => CursorBox({
class_name: 'toggle-off',
on_primary_click_release: () => Tablet.toggleOsk(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.oskState);
}, 'osk-toggled');
},
child: Label({
class_name: 'osk-toggle',
xalign: 0.6,
label: '󰌌 ',
}),
});