nixos-configs/devices/wim/config/ags/js/bar/items/tablet-toggle.js
matt1432 3b4a541d2e
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: (ags bar): make hover revs more consistent
2023-12-28 00:19:57 -05:00

24 lines
585 B
JavaScript

import { Box, 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.toggleMode(),
setup: (self) => {
self.hook(Tablet, () => {
self.toggleClassName('toggle-on', Tablet.tabletMode);
}, 'mode-toggled');
},
child: Box({
class_name: 'tablet-toggle',
vertical: false,
children: [Label(' 󰦧 ')],
}),
});