2023-10-31 08:32:40 -04:00
|
|
|
import App from 'resource:///com/github/Aylur/ags/app.js';
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-10-31 08:32:40 -04:00
|
|
|
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
2023-09-05 15:10:25 -04:00
|
|
|
|
2023-12-05 09:42:06 -05:00
|
|
|
import Audio from './audio.js';
|
2023-12-05 11:35:40 -05:00
|
|
|
import Bluetooth from './bluetooth.js';
|
2023-12-07 15:28:58 -05:00
|
|
|
import Brightness from './brightness.js';
|
2023-12-05 09:42:06 -05:00
|
|
|
import KeyboardLayout from './keyboard-layout.js';
|
|
|
|
import Network from './network.js';
|
|
|
|
|
2023-12-18 23:20:32 -05:00
|
|
|
import CursorBox from '../../misc/cursorbox.js';
|
2023-12-05 09:42:06 -05:00
|
|
|
import Separator from '../../misc/separator.js';
|
|
|
|
|
|
|
|
const SPACING = 4;
|
2023-09-11 19:57:21 -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: (self) => {
|
2023-12-18 18:00:30 -05:00
|
|
|
// @ts-expect-error
|
2023-12-18 23:20:32 -05:00
|
|
|
App.getWindow('notification-center').attribute.set_x_pos(
|
2023-12-18 18:00:30 -05:00
|
|
|
self.get_allocation(),
|
|
|
|
'right',
|
|
|
|
);
|
2023-12-12 11:21:27 -05:00
|
|
|
|
|
|
|
App.toggleWindow('quick-settings');
|
|
|
|
},
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-12-17 00:01:58 -05:00
|
|
|
setup: (self) => {
|
|
|
|
self.hook(App, (_, windowName, visible) => {
|
|
|
|
if (windowName === 'quick-settings') {
|
|
|
|
self.toggleClassName('toggle-on', visible);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
child: Box({
|
2023-12-18 18:00:30 -05:00
|
|
|
class_name: 'quick-settings-toggle',
|
2023-10-20 23:11:21 -04:00
|
|
|
vertical: false,
|
2023-12-05 09:42:06 -05:00
|
|
|
children: [
|
|
|
|
Separator(SPACING),
|
|
|
|
|
|
|
|
KeyboardLayout(),
|
|
|
|
|
2023-12-07 15:28:58 -05:00
|
|
|
Brightness(),
|
|
|
|
|
2023-12-05 09:42:06 -05:00
|
|
|
Audio(),
|
|
|
|
|
2023-12-05 11:35:40 -05:00
|
|
|
Bluetooth(),
|
2023-12-05 09:42:06 -05:00
|
|
|
|
|
|
|
Network(),
|
|
|
|
|
|
|
|
Label(' '),
|
|
|
|
|
|
|
|
Separator(SPACING),
|
|
|
|
],
|
2023-09-05 15:10:25 -04:00
|
|
|
}),
|
|
|
|
});
|