mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 修复部分托盘无图标的问题
未在初始化时获取图标信息 Log: 修复部分托盘无图标的问题 Influence: 安全中心、授权管理等应用的托盘图标 Bug: https://pms.uniontech.com/bug-view-160761.html Change-Id: I5b4a3a2d7b688ad0275e3acfe2bd72841a75e92a
This commit is contained in:
parent
fabfe1846f
commit
c73ef98002
@ -156,6 +156,8 @@ SNITrayWidget::SNITrayWidget(const QString &sniServicePath, QWidget *parent)
|
||||
connect(m_sniInter, &StatusNotifierItem::NewStatus, [ = ] {
|
||||
onSNIStatusChanged(m_sniInter->status());
|
||||
});
|
||||
|
||||
initSNIPropertys();
|
||||
}
|
||||
|
||||
QString SNITrayWidget::itemKeyForConfig()
|
||||
@ -251,6 +253,30 @@ uint SNITrayWidget::servicePID(const QString &servicePath)
|
||||
return conn.interface()->servicePid(serviceName);
|
||||
}
|
||||
|
||||
void SNITrayWidget::initSNIPropertys()
|
||||
{
|
||||
m_sniAttentionIconName = m_sniInter->attentionIconName();
|
||||
m_sniAttentionIconPixmap = m_sniInter->attentionIconPixmap();
|
||||
m_sniAttentionMovieName = m_sniInter->attentionMovieName();
|
||||
m_sniCategory = m_sniInter->category();
|
||||
m_sniIconName = m_sniInter->iconName();
|
||||
m_sniIconPixmap = m_sniInter->iconPixmap();
|
||||
m_sniIconThemePath = m_sniInter->iconThemePath();
|
||||
m_sniMenuPath = m_sniInter->menu();
|
||||
m_sniOverlayIconName = m_sniInter->overlayIconName();
|
||||
m_sniOverlayIconPixmap = m_sniInter->overlayIconPixmap();
|
||||
m_sniStatus = m_sniInter->status();
|
||||
|
||||
// 使用同步的方式获取id,否则在插入的时候无法获取正确的位置
|
||||
m_sniInter->setSync(true);
|
||||
m_sniId = m_sniInter->id();
|
||||
m_sniInter->setSync(false);
|
||||
|
||||
m_updateIconTimer->start();
|
||||
// m_updateOverlayIconTimer->start();
|
||||
// m_updateAttentionIconTimer->start();
|
||||
}
|
||||
|
||||
void SNITrayWidget::initMenu()
|
||||
{
|
||||
const QString &sniMenuPath = m_sniMenuPath.path();
|
||||
|
@ -79,6 +79,7 @@ Q_SIGNALS:
|
||||
void statusChanged(SNITrayWidget::ItemStatus status);
|
||||
|
||||
private Q_SLOTS:
|
||||
void initSNIPropertys();
|
||||
void initMenu();
|
||||
void refreshIcon();
|
||||
void refreshOverlayIcon();
|
||||
|
Loading…
x
Reference in New Issue
Block a user