feat(ags): open closer at the same time as windows

This commit is contained in:
matt1432 2023-09-12 14:07:20 -04:00
parent 0cb9f81277
commit bc709eb5f5
2 changed files with 16 additions and 4 deletions

View file

@ -1,5 +1,5 @@
const { Box, Label } = ags.Widget; const { Box, Label } = ags.Widget;
const { toggleWindow } = ags.App; const { toggleWindow, openWindow } = ags.App;
const { DateTime } = imports.gi.GLib; const { DateTime } = imports.gi.GLib;
import { EventBox } from '../misc/cursorbox.js'; import { EventBox } from '../misc/cursorbox.js';
@ -24,7 +24,13 @@ export const Clock = EventBox({
connections: [ connections: [
[ags.App, (box, windowName, visible) => { [ags.App, (box, windowName, visible) => {
if (windowName == 'calendar') { if (windowName == 'calendar') {
Clock.toggleClassName('toggle-on', visible); if (visible) {
Clock.toggleClassName('toggle-on', true);
openWindow('closer');
}
else {
Clock.toggleClassName('toggle-on', false);
}
} }
}], }],
], ],

View file

@ -1,5 +1,5 @@
const { Box, Label, Icon } = ags.Widget; const { Box, Label, Icon } = ags.Widget;
const { toggleWindow } = ags.App; const { toggleWindow, openWindow } = ags.App;
const { Notifications } = ags.Service; const { Notifications } = ags.Service;
import { Separator } from '../misc/separator.js'; import { Separator } from '../misc/separator.js';
@ -11,7 +11,13 @@ export const NotifButton = EventBox({
connections: [ connections: [
[ags.App, (box, windowName, visible) => { [ags.App, (box, windowName, visible) => {
if (windowName == 'notification-center') { if (windowName == 'notification-center') {
NotifButton.toggleClassName('toggle-on', visible); if (visible) {
NotifButton.toggleClassName('toggle-on', true);
openWindow('closer');
}
else {
NotifButton.toggleClassName('toggle-on', false);
}
} }
}], }],
], ],