2023-10-02 12:06:35 -04:00
|
|
|
import { Utils, Widget } from '../../imports.js';
|
|
|
|
const { Box, Label } = Widget;
|
|
|
|
const { subprocess } = Utils;
|
2023-09-05 13:25:32 -04:00
|
|
|
|
2023-09-11 19:57:21 -04:00
|
|
|
import { EventBox } from '../misc/cursorbox.js';
|
2023-09-04 22:34:33 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-09-04 22:34:33 -04:00
|
|
|
export const TabletToggle = EventBox({
|
|
|
|
className: 'toggle-off',
|
2023-09-05 13:25:32 -04:00
|
|
|
onPrimaryClickRelease: function() {
|
|
|
|
subprocess(
|
2023-09-07 23:18:39 -04:00
|
|
|
['bash', '-c', '$AGS_PATH/tablet-toggle.sh toggle'],
|
2023-09-05 13:25:32 -04:00
|
|
|
(output) => {
|
|
|
|
print(output)
|
|
|
|
if (output == 'Tablet') {
|
|
|
|
TabletToggle.toggleClassName('toggle-on', true);
|
|
|
|
} else {
|
|
|
|
TabletToggle.toggleClassName('toggle-on', false);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
child: Box({
|
2023-09-04 22:34:33 -04:00
|
|
|
className: 'tablet-toggle',
|
|
|
|
vertical: false,
|
2023-09-05 13:25:32 -04:00
|
|
|
child: Label({
|
2023-09-04 22:34:33 -04:00
|
|
|
label: " ",
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
});
|