From c875146779b1d533ed91467e81a1d3113dbdcf0a Mon Sep 17 00:00:00 2001 From: Tarulia <556162+mihawk90@users.noreply.github.com> Date: Mon, 29 Jun 2026 03:35:42 +0200 Subject: [PATCH] feat: add setting for static window title (#2183) --- src/i18n/locales/en.json | 2 ++ .../components/window/window-settings.tsx | 24 +++++++++++++++++++ src/renderer/layouts/window-bar.tsx | 15 +++++++++++- src/renderer/store/settings.store.ts | 5 ++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 3215b90a0..516c9ed30 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -1175,6 +1175,8 @@ "webAudio": "Use web audio", "windowBarStyle_description": "Select the style of the window bar", "windowBarStyle": "Window bar style", + "windowBarTrackinfo": "Track info in Window Title", + "windowBarTrackinfo_description": "Show current track's title and artist, queue position, and Playing/Paused state in the Window's Title.", "zoom_description": "Sets the zoom percentage for the application", "zoom": "Zoom percentage", "queryBuilder": "Query builder", diff --git a/src/renderer/features/settings/components/window/window-settings.tsx b/src/renderer/features/settings/components/window/window-settings.tsx index 8b8168f55..72b4fffcb 100644 --- a/src/renderer/features/settings/components/window/window-settings.tsx +++ b/src/renderer/features/settings/components/window/window-settings.tsx @@ -63,6 +63,30 @@ export const WindowSettings = memo(() => { isHidden: !isElectron(), title: t('setting.windowBarStyle'), }, + { + control: ( + { + if (!e) return; + setSettings({ + window: { + windowBarTrackinfo: e.currentTarget.checked, + }, + }); + }} + /> + ), + description: t('setting.windowBarTrackinfo', { + context: 'description', + }), + // tab is hidden entirely right now + // but if it was shown we would want to show this option + // as it also controls the tab title in web + isHidden: false, + title: t('setting.windowBarTrackinfo'), + }, { control: ( { export const WindowBar = () => { const { t } = useTranslation(); const { windowBarStyle } = useWindowSettings(); + const windowBarTrackinfo = useWindowBarTrackinfo(); + const playerStatus = usePlayerStatus(); const privateMode = useAppStore((state) => state.privateMode); const handleMinimize = () => minimize(); @@ -153,6 +161,10 @@ export const WindowBar = () => { const title = useMemo(() => { const privateModeString = privateMode ? t('page.windowBar.privateMode') : ''; + if (!windowBarTrackinfo) { + return `Feishin${privateMode ? ` ${privateModeString}` : ''}`; + } + // Show radio information if radio is active if (isRadioActive) { const radioStatusString = !isRadioPlaying ? t('page.windowBar.paused') : ''; @@ -194,6 +206,7 @@ export const WindowBar = () => { queueLength, stationName, t, + windowBarTrackinfo, ]); useEffect(() => { diff --git a/src/renderer/store/settings.store.ts b/src/renderer/store/settings.store.ts index be2be4ea1..dcabe2cff 100644 --- a/src/renderer/store/settings.store.ts +++ b/src/renderer/store/settings.store.ts @@ -678,6 +678,7 @@ const WindowSettingsSchema = z.object({ startMinimized: z.boolean(), tray: z.boolean(), windowBarStyle: z.nativeEnum(Platform), + windowBarTrackinfo: z.boolean(), }); const QueryValueInputTypeSchema = z.enum([ @@ -2014,6 +2015,7 @@ const initialState: SettingsState = { startMinimized: false, tray: true, windowBarStyle: platformDefaultWindowBarStyle, + windowBarTrackinfo: true, }, }; @@ -2560,6 +2562,9 @@ export const useWindowSettings = () => useSettingsStore((state) => state.window, export const useWindowBarStyle = () => useSettingsStore((state) => state.window.windowBarStyle, shallow); +export const useWindowBarTrackinfo = () => + useSettingsStore((state) => state.window.windowBarTrackinfo, shallow); + export const useHotkeySettings = () => useSettingsStore((state) => state.hotkeys, shallow); export const useHotkeyBindings = () => useSettingsStore((state) => state.hotkeys.bindings, shallow);