2023-12-18 18:00:30 -05:00
|
|
|
import { Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
2023-09-04 22:27:34 -04:00
|
|
|
|
2024-01-13 23:38:31 -05:00
|
|
|
import Tablet from '../../../services/tablet.ts';
|
|
|
|
import CursorBox from '../../misc/cursorbox.ts';
|
2023-09-04 22:47:12 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-12-18 23:20:32 -05:00
|
|
|
export default () => CursorBox({
|
|
|
|
class_name: 'toggle-off',
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-12-18 23:20:32 -05:00
|
|
|
on_primary_click_release: () => Tablet.toggleOsk(),
|
2023-10-17 13:47:02 -04:00
|
|
|
|
2023-12-19 12:28:29 -05:00
|
|
|
setup: (self) => {
|
|
|
|
self.hook(Tablet, () => {
|
|
|
|
self.toggleClassName('toggle-on', Tablet.oskState);
|
|
|
|
}, 'osk-toggled');
|
|
|
|
},
|
|
|
|
|
2023-12-18 18:00:30 -05:00
|
|
|
child: Label({
|
|
|
|
class_name: 'osk-toggle',
|
|
|
|
xalign: 0.6,
|
|
|
|
label: ' ',
|
2023-10-20 23:11:21 -04:00
|
|
|
}),
|
2023-12-19 12:28:29 -05:00
|
|
|
});
|