feat(ui): add HiDPI zoom controls and hotkeys

This commit is contained in:
vicrodh committed 2026-01-14 02:44:27 -06:00
1 parent 540844de9f
commit 05ef074e4f
4 files changed
+63 -1

No files matched your search

+18
View File
@@ -6,6 +6,7 @@
*/
import { invoke } from '@tauri-apps/api/core';
import { getCurrent } from '@tauri-apps/api/webview';
import { goBack, goForward } from '$lib/stores/navigationStore';
// ============ Theme Management ============
@@ -20,6 +21,22 @@ export function loadSavedTheme(): void {
}
}
/**
* Apply saved UI zoom level (Tauri webview zoom)
*/
export async function applySavedZoom(): Promise<void> {
const savedZoom = localStorage.getItem('qbz-zoom-level');
if (!savedZoom) return;
const zoom = Number.parseFloat(savedZoom);
if (!Number.isFinite(zoom) || zoom <= 0) return;
try {
await getCurrent().setZoom(zoom);
} catch (err) {
console.warn('Failed to apply saved zoom:', err);
}
}
// ============ Last.fm Session ============
/**
@@ -87,6 +104,7 @@ export interface BootstrapResult {
export function bootstrapApp(): BootstrapResult {
// Load theme
loadSavedTheme();
void applySavedZoom();
// Setup mouse navigation
const cleanupMouse = setupMouseNavigation();