mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
feat(tray): show now-playing track in tray + i18n menu labels (#395)
* feat(tray): show now-playing track in tray icon tooltip
Mirrors the current track to the tray tooltip ("Artist – Title") on every
play/pause/track change, falling back to "Psysonic" when nothing is playing.
The cached value survives tray hide/show via a new TrayTooltip state, and
is truncated to 127 chars for Windows NOTIFYICONDATA.szTip.
Closes #383
* feat(tray): linux fallback — disabled menu item shows now-playing track
AppIndicator on Linux has no hover-tooltip API, so the tooltip command was
a silent no-op there. Adds a disabled menu entry at the top of the tray
right-click menu that mirrors the same text. Updated in lockstep with the
Win/macOS tooltip via set_tray_tooltip.
* i18n(tray): localize tray menu labels
Adds a `tray` namespace in all 8 locales (en/de/fr/nl/zh/nb/ru/es) for
Play/Pause, Next/Previous, Show/Hide, Exit, and the Linux-only
"Nothing playing" placeholder.
Rust side: TrayMenuLabels state holds the cached translations and
TrayMenuItems holds the live MenuItem handles. New set_tray_menu_labels
command pushes new strings + applies them via set_text without rebuilding
the tray icon.
Frontend pushes the labels on mount and on every i18n.on('languageChanged').
This commit is contained in:
committed by
GitHub
parent
20a083a9a6
commit
2ea22635e5
@@ -1737,4 +1737,12 @@ export const enTranslation = {
|
||||
exitEndedBody: '"{{name}}" has ended. Hope you had fun.',
|
||||
exitOk: 'OK',
|
||||
},
|
||||
tray: {
|
||||
playPause: 'Play / Pause',
|
||||
nextTrack: 'Next Track',
|
||||
previousTrack: 'Previous Track',
|
||||
showHide: 'Show / Hide',
|
||||
exitPsysonic: 'Exit Psysonic',
|
||||
nothingPlaying: 'Nothing playing',
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user