fix: mute icon not sync changed

add signal
This commit is contained in:
Zhang Dingyuan 2023-03-07 11:37:49 +08:00 committed by deepin-bot[bot]
parent 09b5434d3c
commit c65ddcdbc9
3 changed files with 9 additions and 0 deletions

View File

@ -208,6 +208,8 @@ void SoundItem::refreshIcon()
m_iconPixmap = ImageUtil::loadSvg(iconString, ":/", iconSize, ratio);
update();
emit iconChanged();
}
void SoundItem::refreshTips(const int volume, const bool force)

View File

@ -39,6 +39,7 @@ public:
signals:
void requestContextMenu() const;
void iconChanged() const;
protected:
void resizeEvent(QResizeEvent *e);

View File

@ -57,6 +57,12 @@ void SoundPlugin::init(PluginProxyInterface *proxyInter)
connect(m_soundDeviceWidget.data(), &SoundDevicesWidget::requestHide, this, [ this ] {
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
});
connect(m_soundItem.data(), &SoundItem::iconChanged, this, [=] {
m_proxyInter->updateDockInfo(this, DockPart::QuickPanel);
m_proxyInter->updateDockInfo(this, DockPart::QuickShow);
m_proxyInter->itemUpdate(this, SOUND_KEY);
});
}
void SoundPlugin::pluginStateSwitched()