Update volumemixer.js

This commit is contained in:
end-4
2024-03-27 17:50:03 +07:00
parent 33f871b698
commit 0537e94004
@@ -6,11 +6,9 @@ import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
const { Box, Button, Icon, Label, Scrollable, Slider, Stack } = Widget; const { Box, Button, Icon, Label, Scrollable, Slider, Stack } = Widget;
import { MaterialIcon } from '../../.commonwidgets/materialicon.js'; import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
import { setupCursorHover } from '../../.widgetutils/cursorhover.js'; import { setupCursorHover } from '../../.widgetutils/cursorhover.js';
import { AnimatedSlider } from '../../.commonwidgets/cairo_slider.js'; // import { AnimatedSlider } from '../../.commonwidgets/cairo_slider.js';
const AppVolume = (stream) => { const AppVolume = (stream) => Box({
// console.log(stream)
return Box({
className: 'sidebar-volmixer-stream spacing-h-10', className: 'sidebar-volmixer-stream spacing-h-10',
children: [ children: [
Icon({ Icon({
@@ -35,11 +33,9 @@ const AppVolume = (stream) => {
truncate: 'end', truncate: 'end',
label: stream.description, label: stream.description,
className: 'txt-small', className: 'txt-small',
setup: (self) => { setup: (self) => self.hook(stream, (self) => {
self.hook(stream, (self) => {
self.label = `${stream.description}` self.label = `${stream.description}`
}) })
}
}), }),
Slider({ Slider({
drawValue: false, drawValue: false,
@@ -50,11 +46,9 @@ const AppVolume = (stream) => {
onChange: ({ value }) => { onChange: ({ value }) => {
stream.volume = value; stream.volume = value;
}, },
setup: (self) => { setup: (self) => self.hook(stream, (self) => {
self.hook(stream, (self) => {
self.value = stream.volume; self.value = stream.volume;
}) })
}
}), }),
// Box({ // Box({
// homogeneous: true, // homogeneous: true,
@@ -67,8 +61,7 @@ const AppVolume = (stream) => {
] ]
}) })
] ]
}) });
}
export default (props) => { export default (props) => {
const emptyContent = Box({ const emptyContent = Box({