mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
fix: 修复音量调节控件幅度不正确的问题
音量调节幅度为2%,这里的控件上次修改时漏掉了 亮度调节也有类似的问题,一并修复 Log: 修复音量调节控件幅度不正确的问题 Influence: 音量控件调节幅度 Bug: https://pms.uniontech.com/bug-view-172417.html Change-Id: I945698a16b8ad19dee8d22e71cc639ca68204946
This commit is contained in:
parent
b698b07dde
commit
c35bee0c65
@ -52,7 +52,9 @@ void BrightnessAdjWidget::loadBrightnessItem()
|
||||
QPixmap rightPixmap = ImageUtil::loadSvg(":/icons/resources/brightnesshigh", QSize(20, 20));
|
||||
sliderContainer->setIcon(SliderContainer::IconPosition::LeftIcon,leftPixmap, QSize(), 12);
|
||||
sliderContainer->setIcon(SliderContainer::IconPosition::RightIcon, rightPixmap, QSize(), 12);
|
||||
|
||||
// 需求要求调节范围是10%-100%,且调节幅度为1%
|
||||
sliderContainer->setRange(10, 100);
|
||||
sliderContainer->setPageStep(1);
|
||||
sliderContainer->setFixedWidth(310);
|
||||
sliderContainer->setFixedHeight(itemHeight);
|
||||
sliderContainer->updateSliderValue(monitor->brightness());
|
||||
|
@ -112,6 +112,8 @@ void SoundDevicesWidget::initUi()
|
||||
|
||||
SliderProxyStyle *proxy = new SliderProxyStyle(SliderProxyStyle::Normal);
|
||||
m_sliderContainer->setSliderProxyStyle(proxy);
|
||||
m_sliderContainer->setRange(0, std::round(m_soundInter->maxUIVolume() * 100.00));
|
||||
m_sliderContainer->setPageStep(2);
|
||||
sliderLayout->addWidget(m_sliderContainer);
|
||||
|
||||
QHBoxLayout *topLayout = new QHBoxLayout(this);
|
||||
@ -212,7 +214,9 @@ void SoundDevicesWidget::initConnection()
|
||||
connect(m_delegate, &SettingDelegate::selectIndexChanged, this, &SoundDevicesWidget::onSelectIndexChanged);
|
||||
connect(m_soundInter, &DBusAudio::PortEnabledChanged, this, &SoundDevicesWidget::onAudioDevicesChanged);
|
||||
connect(m_soundInter, &DBusAudio::CardsWithoutUnavailableChanged, this, &SoundDevicesWidget::onAudioDevicesChanged);
|
||||
|
||||
connect(m_soundInter, &DBusAudio::MaxUIVolumeChanged, this, [ = ] (double maxValue) {
|
||||
m_sliderContainer->setRange(0, std::round(maxValue * 100.00));
|
||||
});
|
||||
connect(m_sliderContainer, &SliderContainer::sliderValueChanged, this, [ this ](int value) {
|
||||
m_sinkInter->SetVolume(value * 0.01, true);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user