update styles

This commit is contained in:
end-4 2024-03-24 22:14:55 +07:00
parent 0fd91e18fc
commit 4c5a283c55
4 changed files with 33 additions and 2 deletions

View file

@ -108,7 +108,7 @@ export default (props) => {
});
const listTitle = Box({
vpack: 'start',
className: 'sidebar-group-invisible txt spacing-h-5',
className: 'txt spacing-h-5',
children: [
notifCount,
silenceButton,

View file

@ -42,7 +42,7 @@ const appVolume = (stream) => {
className: 'sidebar-volmixer-stream-slider',
value: stream.volume,
min: 0, max: 1,
onChange: ({value}) => {
onChange: ({ value }) => {
stream.volume = value;
},
setup: (self) => {
@ -83,12 +83,33 @@ export default (props) => {
,
})
})
const status = Box({
className: 'sidebar-volmixer-status spacing-h-5',
children: [
Label({
className: 'txt-small margin-top-5 margin-bottom-8',
attribute: { headphones: undefined },
setup: (self) => {
const updateAudioDevice = (self) => {
const usingHeadphones = (Audio.speaker?.stream?.port)?.toLowerCase().includes('headphone');
if (self.attribute.headphones === undefined ||
self.attribute.headphones !== usingHeadphones) {
self.attribute.headphones = usingHeadphones;
self.label = `Output: ${usingHeadphones ? 'Headphones' : 'Speakers'}`;
}
}
self.hook(Audio, updateAudioDevice);
}
})
]
});
return Box({
...props,
className: 'spacing-v-5',
vertical: true,
children: [
appList,
status,
]
});
}

View file

@ -420,6 +420,10 @@
margin-bottom: 0.682rem;
}
.margin-bottom-8 { // wtf
margin-bottom: 0.545rem;
}
.margin-right-15 {
margin-right: 1.023rem;
}

View file

@ -852,6 +852,7 @@ $waifu_image_overlay_transparency: 0.7;
// color: $onLayer2;
border-bottom: 0.068rem solid $outlineVariant;
padding: 0.682rem;
color: $onSurface;
}
.sidebar-volmixer-stream-appicon {
@ -878,4 +879,9 @@ $waifu_image_overlay_transparency: 0.7;
min-height: 1.364rem;
min-width: 1.364rem;
}
}
.sidebar-volmixer-status {
color: $onSurface;
margin: 0rem 0.682rem;
}