新增鼠标在音量按钮使用滚轮时可以调整音量大小的功能(#2000)

pull/2077/head
lyswhut 2024-08-10 10:18:27 +08:00
parent 6ff7cfde11
commit 85c9ec38db
2 changed files with 6 additions and 1 deletions

View File

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

View File

@ -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>
@ -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)
}