fix hw acc

This commit is contained in:
fly_mc 2024-11-01 08:48:13 +08:00
parent 97a79ae67b
commit 7417bfadc8
2 changed files with 12 additions and 11 deletions

View file

@ -198,17 +198,8 @@ export async function common(createVue: () => App<Element>) {
}, { immediate: true }); }, { immediate: true });
watch(defaultStore.reactiveState.useHardwareAcceleration, v => { watch(defaultStore.reactiveState.useHardwareAcceleration, v => {
if (v) { document.documentElement.classList.toggle('font-smoothing-auto', !v);
const miHwAcc = document.createElement('style'); }, { immediate: true });
miHwAcc.textContent = `html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}`;
document.head.appendChild(miHwAcc);
} else {
document.querySelector('style')?.remove();
}
}, { immediate: true });
// Keep screen on // Keep screen on
const onVisibilityChange = () => document.addEventListener('visibilitychange', () => { const onVisibilityChange = () => document.addEventListener('visibilitychange', () => {

View file

@ -14,6 +14,16 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.font-smoothing-auto * {
-webkit-font-smoothing: auto;
-moz-osx-font-smoothing: auto;
}
:root { :root {
--MI-radius: 12px; --MI-radius: 12px;
--MI-marginFull: 16px; --MI-marginFull: 16px;