ags: sync

This commit is contained in:
end-4
2023-12-29 13:30:25 +07:00
parent 0832ba6b61
commit 2d238efd10
24 changed files with 586 additions and 180 deletions
@@ -2,34 +2,32 @@
const { GLib, Gtk } = imports.gi;
import { App, Service, Utils, Widget } from '../../imports.js';
import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js';
const { Box, EventBox, Icon, Scrollable, Label, Button, Revealer } = Widget;
const { Box, Label, ProgressBar, Revealer } = Widget;
import Brightness from '../../services/brightness.js';
import Indicator from '../../services/indicator.js';
import Notification from '../../lib/notification.js';
const OsdValue = (name, labelConnections, progressConnections, props = {}) => Widget.Box({ // Volume
const OsdValue = (name, labelConnections, progressConnections, props = {}) => Box({ // Volume
...props,
vertical: true,
className: 'osd-bg osd-value',
hexpand: true,
children: [
Widget.Box({
Box({
vexpand: true,
children: [
Widget.Label({
Label({
xalign: 0, yalign: 0, hexpand: true,
className: 'osd-label',
label: `${name}`,
}),
Widget.Label({
Label({
hexpand: false, className: 'osd-value-txt',
label: '100',
connections: labelConnections,
}),
]
}),
Widget.ProgressBar({
ProgressBar({
className: 'osd-progress',
hexpand: true,
vertical: false,
@@ -58,14 +56,14 @@ const volumeIndicator = OsdValue('Volume',
}]],
);
export default () => Widget.Revealer({
export default () => Revealer({
transition: 'slide_down',
connections: [
[Indicator, (revealer, value) => {
revealer.revealChild = (value > -1);
}, 'popup'],
],
child: Widget.Box({
child: Box({
hpack: 'center',
vertical: false,
children: [