Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fd613fd

Browse files
committedNov 14, 2024·
reduce clutter with quiet mode in menu
1 parent 314cf1a commit fd613fd

File tree

3 files changed

+10
-28
lines changed

3 files changed

+10
-28
lines changed
 

‎src/main/menu.ts

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ export default class MenuBuilder {
166166
});
167167
},
168168
},
169+
{
170+
label: 'quiet down',
171+
click: () => {
172+
this.mainWindow.webContents.send('menu-quiet-mode');
173+
},
174+
},
169175

170176
{ type: 'separator' },
171177

‎src/renderer/components/Main.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export default function Main() {
4747
(store) => store.setOverrideScrollToIndex,
4848
);
4949
const skipToNextSong = usePlayerStore((store) => store.skipToNextSong);
50+
const setVolume = usePlayerStore((store) => store.setVolume);
5051

5152
// Component state
5253
const [dialogState, setDialogState] = useState({
@@ -208,6 +209,9 @@ export default function Main() {
208209
'menu-reset-library': () => {
209210
window.electron.ipcRenderer.sendMessage('menu-reset-library');
210211
},
212+
'menu-quiet-mode': () => {
213+
setVolume(2);
214+
},
211215
};
212216

213217
Object.entries(handlers).forEach(([event, handler]) => {

‎src/renderer/components/StaticPlayer.tsx

-28
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import ShuffleOnIcon from '@mui/icons-material/ShuffleOn';
1010
import RepeatIcon from '@mui/icons-material/Repeat';
1111
import Stack from '@mui/material/Stack';
1212
import RepeatOnIcon from '@mui/icons-material/RepeatOn';
13-
import SpatialAudioIcon from '@mui/icons-material/SpatialAudio';
1413
import VolumeSliderStack from './VolumeSliderStack';
1514
import SongProgressAndSongDisplay from './SongProgressAndSongDisplay';
1615
import usePlayerStore from '../store/player';
@@ -99,20 +98,6 @@ export default function StaticPlayer({
9998
)}
10099
</IconButton>
101100
</Tooltip>
102-
<Tooltip title="Quiet Mode">
103-
<IconButton
104-
onClick={() => {
105-
// set the volume to 0.02 so you can listen to a podcast or hear the person next to you
106-
setVolume(2);
107-
}}
108-
sx={{
109-
fontSize: '1rem',
110-
color: 'rgb(133,133,133)',
111-
}}
112-
>
113-
<SpatialAudioIcon fontSize="inherit" />
114-
</IconButton>
115-
</Tooltip>
116101
</div>
117102

118103
{/**
@@ -223,19 +208,6 @@ export default function StaticPlayer({
223208
)}
224209
</IconButton>
225210
</Tooltip>
226-
<Tooltip title="Quiet Mode">
227-
<IconButton
228-
onClick={() => {
229-
setVolume(2.5);
230-
}}
231-
sx={{
232-
fontSize: '1rem',
233-
color: 'rgb(133,133,133)',
234-
}}
235-
>
236-
<SpatialAudioIcon fontSize="inherit" />
237-
</IconButton>
238-
</Tooltip>
239211
</div>
240212
<VolumeSliderStack
241213
onChange={(event, value) => {

0 commit comments

Comments
 (0)
Please sign in to comment.