feat(settings): add title bar configuration

Phase 1 implementation:
- Add titleBarStore.ts for managing title bar visibility
- "Use QBZ title bar" toggle (default ON) - switches between custom and system decorations
- "Remove title bar" toggle (default OFF) - hides title bar completely for tiling WM users
- Dynamically adjust layout heights when title bar is hidden
- Add i18n translations (en/es)
- Settings integrate with Tauri window.setDecorations() API
This commit is contained in:
vicrodh committed 2026-01-23 16:16:20 -06:00
1 parent 921639041c
commit 3ac957ddda
6 files changed
+237 -7

No files matched your search

+37 -1
View File
@@ -44,6 +44,13 @@
type OfflineSettings
} from '$lib/stores/offlineStore';
import { showToast } from '$lib/stores/toastStore';
import {
subscribe as subscribeTitleBar,
getUseCustomTitleBar,
getHideTitleBar,
setUseCustomTitleBar,
setHideTitleBar
} from '$lib/stores/titleBarStore';
import {
getPlaybackPreferences,
setAutoplayMode,
@@ -368,6 +375,10 @@
let systemNotificationsEnabled = $state(true);
let language = $state('Auto');
// Title bar settings
let useCustomTitleBar = $state(getUseCustomTitleBar());
let hideTitleBar = $state(getHideTitleBar());
// Library settings
let fetchQobuzArtistImages = $state(true);
let showQobuzDownloadsInLibrary = $state(false);
@@ -470,6 +481,12 @@
offlineSettings = getOfflineSettings();
});
// Subscribe to title bar state changes
const unsubscribeTitleBar = subscribeTitleBar(() => {
useCustomTitleBar = getUseCustomTitleBar();
hideTitleBar = getHideTitleBar();
});
// Scroll tracking for navigation
const handleScroll = () => {
if (!settingsViewEl) return;
@@ -497,6 +514,7 @@
return () => {
unsubscribeOffline();
unsubscribeZoom();
unsubscribeTitleBar();
settingsViewEl?.removeEventListener('scroll', handleScroll);
};
});
@@ -1660,10 +1678,28 @@
<span class="setting-label">{$t('settings.appearance.inAppToasts')}</span>
<Toggle enabled={toastsEnabled} onchange={(v) => { toastsEnabled = v; setToastsEnabled(v); }} />
</div>
<div class="setting-row last">
<div class="setting-row">
<span class="setting-label">{$t('settings.appearance.systemNotifications')}</span>
<Toggle enabled={systemNotificationsEnabled} onchange={(v) => { systemNotificationsEnabled = v; setSystemNotificationsEnabled(v); }} />
</div>
<div class="setting-row">
<div class="setting-info">
<span class="setting-label">{$t('settings.appearance.useCustomTitleBar')}</span>
<span class="setting-desc">{$t('settings.appearance.useCustomTitleBarDesc')}</span>
</div>
<Toggle
enabled={useCustomTitleBar}
disabled={hideTitleBar}
onchange={(v) => setUseCustomTitleBar(v)}
/>
</div>
<div class="setting-row last">
<div class="setting-info">
<span class="setting-label">{$t('settings.appearance.hideTitleBar')}</span>
<span class="setting-desc">{$t('settings.appearance.hideTitleBarDesc')}</span>
</div>
<Toggle enabled={hideTitleBar} onchange={(v) => setHideTitleBar(v)} />
</div>
</section>
<!-- Offline Library Section -->