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

21 lines
523 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({
2023-12-18 18:00:30 -05:00
class_name: 'toggle-off',
onPrimaryClickRelease: () => Tablet.toggleMode(),
child: Box({
2023-12-18 18:00:30 -05:00
class_name: 'tablet-toggle',
vertical: false,
children: [Label(' 󰦧 ')],
}),
2023-12-18 18:00:30 -05:00
}).hook(Tablet, (self) => {
self.toggleClassName('toggle-on', Tablet.tabletMode);
}, 'mode-toggled');