Fix bugs with Clarity boost select box

This commit is contained in:
redphx 2024-07-17 07:48:36 +07:00
parent 2db246e081
commit 742fd24b8c
4 changed files with 15 additions and 2 deletions

View File

@ -105,6 +105,10 @@ div[class^=HUDButton-module__hiddenContainer] ~ div:not([class^=HUDButton-module
font-family: var(--bx-promptfont-font); font-family: var(--bx-promptfont-font);
} }
.bx-line-through {
text-decoration: line-through
}
select[multiple] { select[multiple] {
overflow: auto; overflow: auto;
} }

View File

@ -68,7 +68,7 @@ export class StreamPlayer {
const filters = []; const filters = [];
const sharpness = this.#options.sharpness || 0; const sharpness = this.#options.sharpness || 0;
if (sharpness != 0) { if (this.#options.processing === StreamVideoProcessing.USM && sharpness != 0) {
const level = (7 - ((sharpness / 2) - 1) * 0.5).toFixed(1); // 5, 5.5, 6, 6.5, 7 const level = (7 - ((sharpness / 2) - 1) * 0.5).toFixed(1); // 5, 5.5, 6, 6.5, 7
const matrix = `0 -1 0 -1 ${level} -1 0 -1 0`; const matrix = `0 -1 0 -1 ${level} -1 0 -1 0`;
this.#$usmMatrix?.setAttributeNS(null, 'kernelMatrix', matrix); this.#$usmMatrix?.setAttributeNS(null, 'kernelMatrix', matrix);

View File

@ -689,5 +689,8 @@ export class StreamSettings {
document.documentElement.appendChild($overlay); document.documentElement.appendChild($overlay);
document.documentElement.appendChild($container); document.documentElement.appendChild($container);
// Update video's settings
onChangeVideoPlayerType();
} }
} }

View File

@ -82,6 +82,9 @@ export class BxSelectElement {
$label.textContent = content; $label.textContent = content;
} }
// Add line-through on disabled option
$label.classList.toggle('bx-line-through', $option && $option.disabled);
// Hide checkbox when the selection is empty // Hide checkbox when the selection is empty
if (isMultiple) { if (isMultiple) {
$checkBox.checked = $option?.selected || false; $checkBox.checked = $option?.selected || false;
@ -123,13 +126,16 @@ export class BxSelectElement {
const observer = new MutationObserver((mutationList, observer) => { const observer = new MutationObserver((mutationList, observer) => {
mutationList.forEach(mutation => { mutationList.forEach(mutation => {
mutation.type === 'childList' && render(); if (mutation.type === 'childList' || mutation.type === 'attributes') {
render();
}
}); });
}); });
observer.observe($select, { observer.observe($select, {
subtree: true, subtree: true,
childList: true, childList: true,
attributes: true,
}); });
render(); render();