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

25 lines
558 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';
import CursorBox from '../../misc/cursorbox.js';
2023-09-04 22:47:12 -04:00
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');
},
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
});