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

24 lines
577 B
JavaScript
Raw Normal View History

import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
import Tablet from '../../../services/tablet.js';
2023-11-16 00:48:50 -05:00
import EventBox from '../../misc/cursorbox.js';
export default () => EventBox({
className: 'toggle-off',
onPrimaryClickRelease: () => Tablet.toggleMode(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.tabletMode);
}, 'mode-toggled');
},
child: Box({
className: 'tablet-toggle',
vertical: false,
children: [Label(' 󰦧 ')],
}),
});