Skip to content

Commit

Permalink
新增鼠标在音量按钮使用滚轮时可以调整音量大小的功能(#2000
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Aug 10, 2024
1 parent 6ff7cfd commit 85c9ec3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions publish/changeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- 新增 是否将歌词显示在状态栏 设置,默认关闭,该功能只在 MacOS 下可用(#1940
- 新增设置-播放详情页设置-延迟歌词滚动设置(#1985
- 新增鼠标在音量按钮使用滚轮时可以调整音量大小的功能(#2000

### 优化

Expand Down
6 changes: 5 additions & 1 deletion src/renderer/components/common/VolumeBtn.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<material-popup-btn :class="$style.btnContent">
<button :class="$style.btn" :aria-label="isMute ? $t('player__volume_muted') : `${$t('player__volume')}${parseInt(volume * 100)}%`">
<button :class="$style.btn" :aria-label="isMute ? $t('player__volume_muted') : `${$t('player__volume')}${parseInt(volume * 100)}%`" @wheel="handleWheel">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" width="100%" viewBox="0 0 24 24" space="preserve">
<use :xlink:href="icon" />
</svg>
Expand Down Expand Up @@ -30,6 +30,10 @@ import { computed } from '@common/utils/vueTools'
import { saveVolumeIsMute } from '@renderer/store/setting'
import { volume, isMute } from '@renderer/store/player/volume'
const handleWheel = (event) => {
window.app_event.setVolume(Math.round(volume.value * 100 + (-event.deltaY / 100 * 2)) / 100)
}
const handleUpdateVolume = (val) => {
window.app_event.setVolume(val)
}
Expand Down

0 comments on commit 85c9ec3

Please sign in to comment.