2023-09-15 23:22:16 -04:00
|
|
|
const { Window, CenterBox, Box, Label, Revealer, Icon } = ags.Widget;
|
2023-09-21 20:01:14 -04:00
|
|
|
const { closeWindow } = ags.App;
|
2023-09-15 23:22:16 -04:00
|
|
|
const { ToggleButton } = imports.gi.Gtk;
|
2023-09-12 14:22:21 -04:00
|
|
|
|
|
|
|
import { ButtonGrid } from './button-grid.js';
|
2023-09-12 15:27:39 -04:00
|
|
|
import { SliderBox } from './slider-box.js';
|
2023-09-15 23:22:16 -04:00
|
|
|
import Player from '../media-player/player.js';
|
|
|
|
import { EventBox } from '../misc/cursorbox.js';
|
2023-09-21 20:01:14 -04:00
|
|
|
import { PopUp } from '../misc/popup.js';
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
const QuickSettingsWidget = Box({
|
|
|
|
className: 'qs-container',
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
Box({
|
|
|
|
className: 'quick-settings',
|
|
|
|
vertical: true,
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Label({
|
|
|
|
label: 'Control Center',
|
|
|
|
className: 'title',
|
|
|
|
halign: 'start',
|
|
|
|
style: 'margin-left: 20px'
|
|
|
|
}),
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
ButtonGrid,
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
SliderBox,
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
EventBox({
|
|
|
|
child: ags.Widget({
|
|
|
|
type: ToggleButton,
|
|
|
|
connections: [['toggled', button => {
|
|
|
|
if (button.get_active()) {
|
|
|
|
button.child.setStyle("-gtk-icon-transform: rotate(0deg);");
|
|
|
|
button.get_parent().get_parent().get_parent().children[1].revealChild = true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
button.child.setStyle('-gtk-icon-transform: rotate(180deg);');
|
|
|
|
button.get_parent().get_parent().get_parent().children[1].revealChild = false;
|
|
|
|
}
|
|
|
|
}]],
|
|
|
|
child: Icon({
|
|
|
|
icon: 'folder-download-symbolic',
|
|
|
|
className: 'arrow',
|
|
|
|
style: `-gtk-icon-transform: rotate(180deg);`,
|
2023-09-15 23:22:16 -04:00
|
|
|
}),
|
|
|
|
}),
|
2023-09-21 20:01:14 -04:00
|
|
|
}),
|
2023-09-15 23:22:16 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
],
|
|
|
|
}),
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
Revealer({
|
|
|
|
transition: 'slide_down',
|
|
|
|
child: Player(),
|
|
|
|
})
|
2023-09-12 14:22:21 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
export const QuickSettings = Window({
|
|
|
|
name: 'quick-settings',
|
|
|
|
layer: 'overlay',
|
|
|
|
anchor: 'top right',
|
|
|
|
margin: [ 8, 5, 0, ],
|
|
|
|
child: PopUp({
|
|
|
|
name: 'quick-settings',
|
|
|
|
child: QuickSettingsWidget,
|
2023-09-12 14:22:21 -04:00
|
|
|
}),
|
|
|
|
});
|