nixos-configs/devices/wim/config/ags/js/quick-settings/main.js

60 lines
1.4 KiB
JavaScript
Raw Normal View History

import { Box, Label, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';
import ButtonGrid from './button-grid.js';
import SliderBox from './slider-box.js';
import Player from '../media-player/player.js';
import PopupWindow from '../misc/popup.js';
2023-10-18 11:53:49 -04:00
import ToggleButton from './toggle-button.js';
2023-11-16 15:02:00 -05:00
const QuickSettingsWidget = () => {
const rev = Revealer({
transition: 'slide_down',
child: Player(),
});
return Box({
className: 'qs-container',
vertical: true,
children: [
Box({
className: 'quick-settings',
vertical: true,
children: [
Label({
label: 'Control Center',
className: 'title',
hpack: 'start',
css: `
margin-left: 20px;
margin-bottom: 30px;
`,
2023-11-16 15:02:00 -05:00
}),
2023-11-16 15:02:00 -05:00
ButtonGrid(),
2023-11-16 15:02:00 -05:00
SliderBox(),
2023-11-16 15:02:00 -05:00
ToggleButton(rev),
2023-11-16 15:02:00 -05:00
],
}),
2023-11-16 15:02:00 -05:00
rev,
2023-11-16 15:02:00 -05:00
],
});
};
const TOP_MARGIN = 6;
const RIGHT_MARGIN = 5;
export default () => PopupWindow({
name: 'quick-settings',
anchor: ['top', 'right'],
margins: [TOP_MARGIN, RIGHT_MARGIN, 0, 0],
child: QuickSettingsWidget(),
});