2023-10-31 08:32:40 -04:00
|
|
|
import { ProgressBar, Overlay, Box } from 'resource:///com/github/Aylur/ags/widget.js';
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-11-21 01:29:46 -05:00
|
|
|
import Brightness from '../../../services/brightness.js';
|
2023-11-16 00:48:50 -05:00
|
|
|
import Separator from '../../misc/separator.js';
|
2023-11-21 01:29:46 -05:00
|
|
|
import Heart from './heart.js';
|
|
|
|
|
|
|
|
const SPACING = 25;
|
|
|
|
const BAR_CUTOFF = 0.33;
|
2023-09-08 15:15:04 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default () => Overlay({
|
2023-10-20 23:11:21 -04:00
|
|
|
tooltipText: 'Brightness',
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
child: ProgressBar({
|
|
|
|
className: 'toggle-off brightness',
|
2023-11-21 01:29:46 -05:00
|
|
|
connections: [[Brightness, (self) => {
|
|
|
|
self.value = Brightness.screen > BAR_CUTOFF ?
|
|
|
|
Brightness.screen :
|
|
|
|
BAR_CUTOFF;
|
2023-11-10 23:51:50 -05:00
|
|
|
}, 'screen']],
|
2023-09-10 00:39:43 -04:00
|
|
|
}),
|
2023-11-21 01:29:46 -05:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
overlays: [
|
|
|
|
Box({
|
2023-11-06 18:37:23 -05:00
|
|
|
css: 'color: #CBA6F7;',
|
2023-10-20 23:11:21 -04:00
|
|
|
children: [
|
2023-11-21 01:29:46 -05:00
|
|
|
Separator(SPACING),
|
2023-10-20 23:11:21 -04:00
|
|
|
Heart(),
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
2023-09-08 15:15:04 -04:00
|
|
|
});
|