Make settings menu a regular window (#113)

This commit is contained in:
Gregory Schier
2024-09-25 12:52:12 -07:00
committed by GitHub
parent 2be45d6101
commit b19748c42e
13 changed files with 201 additions and 111 deletions

15
src-web/font-size.ts Normal file
View File

@@ -0,0 +1,15 @@
// Listen for settings changes, the re-compute theme
import { listen } from '@tauri-apps/api/event';
import type { ModelPayload } from './components/GlobalHooks';
import { getSettings } from './lib/store';
function setFontSizeOnDocument(fontSize: number) {
document.documentElement.style.fontSize = `${fontSize}px`;
}
listen<ModelPayload>('upserted_model', async (event) => {
if (event.payload.model.model !== 'settings') return;
setFontSizeOnDocument(event.payload.model.interfaceFontSize);
}).catch(console.error);
getSettings().then((settings) => setFontSizeOnDocument(settings.interfaceFontSize));