nixos-configs/modules/ags/config/ts/bar/items/tablet-toggle.ts
matt1432 3a8cc994f2
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(ags): switch back to global imports
2024-01-30 11:29:07 -05:00

24 lines
543 B
TypeScript

const { Box, Label } = Widget;
import Tablet from '../../../services/tablet.ts';
import CursorBox from '../../misc/cursorbox.ts';
export default () => CursorBox({
class_name: 'toggle-off',
on_primary_click_release: () => Tablet.toggleMode(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.tabletMode);
}, 'mode-toggled');
},
child: Box({
class_name: 'tablet-toggle',
vertical: false,
children: [Label(' 󰦧 ')],
}),
});