split lyrics settings by key (#1389)

This commit is contained in:
jeffvli
2025-12-25 01:29:31 -08:00
parent 5eb2cff6e9
commit 8205eeed22
16 changed files with 618 additions and 86 deletions
@@ -22,6 +22,7 @@ import { useFastAverageColor } from '/@/renderer/hooks';
import {
useFullScreenPlayerStore,
useFullScreenPlayerStoreActions,
useLyricsDisplaySettings,
useLyricsSettings,
usePlayerData,
usePlayerSong,
@@ -235,19 +236,35 @@ const Controls = ({ isPageHovered }: ControlsProps) => {
} = useFullScreenPlayerStore();
const { setStore } = useFullScreenPlayerStoreActions();
const { setSettings } = useSettingsStoreActions();
const lyricConfig = useLyricsSettings();
const lyricsSettings = useLyricsSettings();
const displaySettings = useLyricsDisplaySettings('default');
const lyricConfig = { ...lyricsSettings, ...displaySettings };
const handleToggleFullScreenPlayer = () => {
setStore({ expanded: !expanded });
};
const handleLyricsSettings = (property: string, value: any) => {
setSettings({
lyrics: {
...useSettingsStore.getState().lyrics,
[property]: value,
},
});
const displayProperties = ['fontSize', 'fontSizeUnsync', 'gap', 'gapUnsync'];
if (displayProperties.includes(property)) {
const currentDisplay = useSettingsStore.getState().lyricsDisplay;
setSettings({
lyricsDisplay: {
...currentDisplay,
default: {
...currentDisplay.default,
[property]: value,
},
},
});
} else {
setSettings({
lyrics: {
...useSettingsStore.getState().lyrics,
[property]: value,
},
});
}
};
useHotkeys([['Escape', handleToggleFullScreenPlayer]]);