2023-09-05 15:10:25 -04:00
|
|
|
const { Box, Label } = ags.Widget;
|
2023-09-12 14:42:53 -04:00
|
|
|
const { toggleWindow, openWindow } = ags.App;
|
2023-09-05 15:10:25 -04:00
|
|
|
|
2023-09-11 19:57:21 -04:00
|
|
|
import { EventBox } from '../misc/cursorbox.js';
|
2023-09-13 19:04:23 -04:00
|
|
|
import { closeAll } from '../misc/closer.js';
|
2023-09-11 19:57:21 -04:00
|
|
|
|
2023-09-05 15:10:25 -04:00
|
|
|
export const QsToggle = EventBox({
|
|
|
|
className: 'toggle-off',
|
2023-09-12 14:42:53 -04:00
|
|
|
onPrimaryClickRelease: () => toggleWindow('quick-settings'),
|
|
|
|
connections: [
|
|
|
|
[ags.App, (box, windowName, visible) => {
|
|
|
|
if (windowName == 'quick-settings') {
|
|
|
|
if (visible) {
|
2023-09-05 15:10:25 -04:00
|
|
|
QsToggle.toggleClassName('toggle-on', true);
|
2023-09-12 14:42:53 -04:00
|
|
|
openWindow('closer');
|
|
|
|
}
|
|
|
|
else {
|
2023-09-05 15:10:25 -04:00
|
|
|
QsToggle.toggleClassName('toggle-on', false);
|
2023-09-12 14:42:53 -04:00
|
|
|
closeAll();
|
2023-09-05 15:10:25 -04:00
|
|
|
}
|
2023-09-12 14:42:53 -04:00
|
|
|
}
|
|
|
|
}],
|
|
|
|
],
|
2023-09-05 15:10:25 -04:00
|
|
|
child: Box({
|
|
|
|
className: 'quick-settings-toggle',
|
|
|
|
vertical: false,
|
|
|
|
child: Label({
|
|
|
|
label: " ",
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
});
|