From f86353200f020b2fd6f30f2bad415108e610b318 Mon Sep 17 00:00:00 2001 From: iiPython Date: Fri, 2 Feb 2024 17:53:48 -0600 Subject: [PATCH 1/5] Add a button size setting --- src/i18n/locales/en.json | 2 ++ .../player/components/center-controls.tsx | 23 ++++++++-------- .../components/general/control-settings.tsx | 27 +++++++++++++++++++ src/renderer/store/settings.store.ts | 2 ++ 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index d491fad1a..d4f25766b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -400,6 +400,8 @@ "audioExclusiveMode_description": "enable exclusive output mode. In this mode, the system is usually locked out, and only mpv will be able to output audio", "audioPlayer": "audio player", "audioPlayer_description": "select the audio player to use for playback", + "buttonSize": "Button size", + "buttonSize_description": "The size of the player bar buttons", "clearCache": "Clear browser cache", "clearCache_description": "A 'hard clear' of Feishin. In addition to clearing Feishin's cache, empty the browser cache (saved images and other assets). Server credentials and settings are preserved.", "clearQueryCache": "Clear Feishin cache", diff --git a/src/renderer/features/player/components/center-controls.tsx b/src/renderer/features/player/components/center-controls.tsx index d84685c07..cb27df613 100644 --- a/src/renderer/features/player/components/center-controls.tsx +++ b/src/renderer/features/player/components/center-controls.tsx @@ -98,6 +98,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { const [isSeeking, setIsSeeking] = useState(false); const currentSong = useCurrentSong(); const skip = useSettingsStore((state) => state.general.skipButtons); + const buttonSize = useSettingsStore((state) => state.general.buttonSize); const playerType = usePlayerType(); const player1 = playersRef?.current?.player1; const player2 = playersRef?.current?.player2; @@ -171,7 +172,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { } + icon={} tooltip={{ label: t('player.stop', { postProcess: 'sentenceCase' }), }} @@ -180,7 +181,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { /> } + icon={} tooltip={{ label: shuffle === PlayerShuffle.NONE @@ -194,7 +195,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { onClick={handleToggleShuffle} /> } + icon={} tooltip={{ label: t('player.previous', { postProcess: 'sentenceCase' }), }} @@ -203,7 +204,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { /> {skip?.enabled && ( } + icon={} tooltip={{ label: t('player.skip', { context: 'back', @@ -218,9 +219,9 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { disabled={currentSong?.id === undefined} icon={ status === PlayerStatus.PAUSED ? ( - + ) : ( - + ) } tooltip={{ @@ -234,7 +235,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { /> {skip?.enabled && ( } + icon={} tooltip={{ label: t('player.skip', { context: 'forward', @@ -246,7 +247,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { /> )} } + icon={} tooltip={{ label: t('player.next', { postProcess: 'sentenceCase' }), }} @@ -257,9 +258,9 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { $isActive={repeat !== PlayerRepeat.NONE} icon={ repeat === PlayerRepeat.ONE ? ( - + ) : ( - + ) } tooltip={{ @@ -285,7 +286,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => { /> } + icon={} tooltip={{ label: t('player.playRandom', { postProcess: 'sentenceCase' }), }} diff --git a/src/renderer/features/settings/components/general/control-settings.tsx b/src/renderer/features/settings/components/general/control-settings.tsx index 35e6f2fcd..3f406fd28 100644 --- a/src/renderer/features/settings/components/general/control-settings.tsx +++ b/src/renderer/features/settings/components/general/control-settings.tsx @@ -36,6 +36,33 @@ export const ControlSettings = () => { const { setSettings } = useSettingsStoreActions(); const controlOptions = [ + { + control: ( + { + if (!e) return; + const newVal = e.currentTarget.value + ? Math.min(Math.max(Number(e.currentTarget.value), 15), 30) + : settings.buttonSize; + setSettings({ + general: { + ...settings, + buttonSize: newVal, + }, + }); + }} + /> + ), + description: t('setting.buttonSize', { + context: 'description', + postProcess: 'sentenceCase', + }), + isHidden: false, + title: t('setting.buttonSize', { postProcess: 'sentenceCase' }), + }, { control: ( Date: Sat, 3 Feb 2024 10:12:11 -0600 Subject: [PATCH 2/5] Reduce setting size and add px suffix --- .../features/settings/components/general/control-settings.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/features/settings/components/general/control-settings.tsx b/src/renderer/features/settings/components/general/control-settings.tsx index 3f406fd28..b0ec66f83 100644 --- a/src/renderer/features/settings/components/general/control-settings.tsx +++ b/src/renderer/features/settings/components/general/control-settings.tsx @@ -39,9 +39,11 @@ export const ControlSettings = () => { { control: ( { if (!e) return; const newVal = e.currentTarget.value From 7091be80b861af1bb1c29b795509c2ca2370d4b8 Mon Sep 17 00:00:00 2001 From: iiPython Date: Sat, 3 Feb 2024 10:24:59 -0600 Subject: [PATCH 3/5] Looks like I don't need || inside of control-settings --- .../features/settings/components/general/control-settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/features/settings/components/general/control-settings.tsx b/src/renderer/features/settings/components/general/control-settings.tsx index b0ec66f83..899082769 100644 --- a/src/renderer/features/settings/components/general/control-settings.tsx +++ b/src/renderer/features/settings/components/general/control-settings.tsx @@ -39,7 +39,7 @@ export const ControlSettings = () => { { control: ( Date: Sat, 3 Feb 2024 15:17:40 -0600 Subject: [PATCH 4/5] Update translation --- src/i18n/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index d4f25766b..a6c7cebea 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -400,7 +400,7 @@ "audioExclusiveMode_description": "enable exclusive output mode. In this mode, the system is usually locked out, and only mpv will be able to output audio", "audioPlayer": "audio player", "audioPlayer_description": "select the audio player to use for playback", - "buttonSize": "Button size", + "buttonSize": "Player bar button size", "buttonSize_description": "The size of the player bar buttons", "clearCache": "Clear browser cache", "clearCache_description": "A 'hard clear' of Feishin. In addition to clearing Feishin's cache, empty the browser cache (saved images and other assets). Server credentials and settings are preserved.", From 3917c157ad84b2e3bd275948738002755ebf5b0f Mon Sep 17 00:00:00 2001 From: iiPython Date: Sat, 3 Feb 2024 15:20:46 -0600 Subject: [PATCH 5/5] Bump settings version to 7 --- src/renderer/store/settings.store.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/store/settings.store.ts b/src/renderer/store/settings.store.ts index fc37b4340..2449579cc 100644 --- a/src/renderer/store/settings.store.ts +++ b/src/renderer/store/settings.store.ts @@ -600,7 +600,7 @@ export const useSettingsStore = create()( return merge(currentState, persistedState); }, name: 'store_settings', - version: 6, + version: 7, }, ), );