nixos-configs/config/ags/js/bar/quick-settings.js

32 lines
789 B
JavaScript
Raw Normal View History

2023-09-05 15:10:25 -04:00
const { Box, Label } = ags.Widget;
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';
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',
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);
openWindow('closer');
}
else {
2023-09-05 15:10:25 -04:00
QsToggle.toggleClassName('toggle-on', false);
closeAll();
2023-09-05 15:10:25 -04:00
}
}
}],
],
2023-09-05 15:10:25 -04:00
child: Box({
className: 'quick-settings-toggle',
vertical: false,
child: Label({
label: "  ",
}),
}),
});