diff --git a/plugins/sound/sounddeviceswidget.cpp b/plugins/sound/sounddeviceswidget.cpp index 7557b6511..907b25d00 100644 --- a/plugins/sound/sounddeviceswidget.cpp +++ b/plugins/sound/sounddeviceswidget.cpp @@ -168,14 +168,14 @@ void SoundDevicesWidget::onAudioDevicesChanged() void SoundDevicesWidget::initConnection() { - connect(m_audioSink, &DBusSink::VolumeChanged, m_sliderContainer, &SliderContainer::updateSliderValue); + connect(m_audioSink, &DBusSink::VolumeChanged, this, [ = ](double value) { m_sliderContainer->updateSliderValue(value * 100); }); connect(m_volumeModel, &DBusAudio::DefaultSinkChanged, this, &SoundDevicesWidget::onDefaultSinkChanged); connect(m_delegate, &SettingDelegate::selectIndexChanged, this, &SoundDevicesWidget::onSelectIndexChanged); connect(m_volumeModel, &DBusAudio::PortEnabledChanged, this, &SoundDevicesWidget::onAudioDevicesChanged); connect(m_volumeModel, &DBusAudio::CardsWithoutUnavailableChanged, this, &SoundDevicesWidget::onAudioDevicesChanged); connect(m_sliderContainer, &SliderContainer::sliderValueChanged, this, [ this ](int value) { - m_audioSink->SetVolume(value, true); + m_audioSink->SetVolume(value * 0.01, true); }); } diff --git a/plugins/sound/soundplugin.cpp b/plugins/sound/soundplugin.cpp index c2c8be211..5e97e5f01 100644 --- a/plugins/sound/soundplugin.cpp +++ b/plugins/sound/soundplugin.cpp @@ -101,9 +101,9 @@ QWidget *SoundPlugin::itemTipsWidget(const QString &itemKey) QWidget *SoundPlugin::itemPopupApplet(const QString &itemKey) { - if (itemKey == SOUND_KEY) { + if (itemKey == SOUND_KEY) return m_soundItem->popupApplet(); - } + if (itemKey == QUICK_ITEM_KEY) return m_soundDeviceWidget.data(); diff --git a/plugins/sound/soundwidget.cpp b/plugins/sound/soundwidget.cpp index 3f6fbfbac..df3f6f0ae 100644 --- a/plugins/sound/soundwidget.cpp +++ b/plugins/sound/soundwidget.cpp @@ -80,7 +80,7 @@ void SoundWidget::initUi() void SoundWidget::initConnection() { - connect(m_defaultSink, &DBusSink::VolumeChanged, m_sliderContainer, &SliderContainer::updateSliderValue); + connect(m_defaultSink, &DBusSink::VolumeChanged, this, [ this ](double value) { m_sliderContainer->updateSliderValue(value * 100); }); connect(m_dbusAudio, &DBusAudio::DefaultSinkChanged, this, [ this ](const QDBusObjectPath &value) { if (m_defaultSink) @@ -92,7 +92,7 @@ void SoundWidget::initConnection() }); connect(m_sliderContainer, &SliderContainer::sliderValueChanged, this, [ this ](int value) { - m_defaultSink->SetVolume(value, true); + m_defaultSink->SetVolume(value * 0.01, true); }); connect(m_defaultSink, &DBusSink::MuteChanged, this, [ this ] {