2023-10-31 08:32:40 -04:00
|
|
|
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
2023-09-05 13:25:32 -04:00
|
|
|
|
2023-11-21 01:29:46 -05:00
|
|
|
import Tablet from '../../../services/tablet.js';
|
2023-11-16 00:48:50 -05:00
|
|
|
import EventBox from '../../misc/cursorbox.js';
|
2023-09-04 22:34:33 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default () => EventBox({
|
2023-12-18 18:00:30 -05:00
|
|
|
class_name: 'toggle-off',
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-11-04 13:39:48 -04:00
|
|
|
onPrimaryClickRelease: () => Tablet.toggleMode(),
|
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
child: Box({
|
2023-12-18 18:00:30 -05:00
|
|
|
class_name: 'tablet-toggle',
|
2023-10-20 23:11:21 -04:00
|
|
|
vertical: false,
|
2023-11-06 21:36:12 -05:00
|
|
|
children: [Label(' ')],
|
2023-09-04 22:34:33 -04:00
|
|
|
}),
|
2023-12-18 18:00:30 -05:00
|
|
|
|
|
|
|
}).hook(Tablet, (self) => {
|
|
|
|
self.toggleClassName('toggle-on', Tablet.tabletMode);
|
|
|
|
}, 'mode-toggled');
|