feat: P3 final batch - zoom, fonts, dark mode, tech debt cleanup
- Page zoom control (0.5-2.0x, localStorage) - Custom monospace font selector (6 presets + custom) - Element Plus dark mode final fixes (dropdown, message-box, switch, popper) - AGENTS.md updated with correct paths + new modules/components/IPC channels - ROADMAP: window state persistence already done via win-state.ts - ROADMAP: tech debt items marked done
This commit is contained in:
+19
-1
@@ -9,6 +9,8 @@ export const useAppStore = defineStore('app', () => {
|
||||
const isDark = ref(true)
|
||||
const fontSize = ref<number>(Number(localStorage.getItem('fontSize')) || 13)
|
||||
const scanCount = ref<number>(Number(localStorage.getItem('scanCount')) || 100)
|
||||
const zoom = ref<number>(Number(localStorage.getItem('zoom')) || 1.0)
|
||||
const fontFamily = ref<string>(localStorage.getItem('fontFamily') || 'Cascadia Code')
|
||||
|
||||
function applyTheme(mode: ThemeMode, osDark?: boolean) {
|
||||
theme.value = mode
|
||||
@@ -45,5 +47,21 @@ export const useAppStore = defineStore('app', () => {
|
||||
localStorage.setItem('scanCount', String(count))
|
||||
}
|
||||
|
||||
return { theme, isDark, fontSize, scanCount, setTheme, setFontSize, setScanCount }
|
||||
function setZoom(value: number) {
|
||||
zoom.value = value
|
||||
localStorage.setItem('zoom', String(value))
|
||||
document.body.style.zoom = String(value)
|
||||
}
|
||||
|
||||
function setFontFamily(value: string) {
|
||||
fontFamily.value = value
|
||||
localStorage.setItem('fontFamily', value)
|
||||
document.documentElement.style.setProperty('--font-mono', value)
|
||||
}
|
||||
|
||||
// Apply saved zoom and fontFamily on mount
|
||||
document.body.style.zoom = String(zoom.value)
|
||||
document.documentElement.style.setProperty('--font-mono', fontFamily.value)
|
||||
|
||||
return { theme, isDark, fontSize, scanCount, zoom, fontFamily, setTheme, setFontSize, setScanCount, setZoom, setFontFamily }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user