mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fixed(sni):invalid plugin not insert to tray
无效插件不添加到托盘区域,避免托盘出现空图标
This commit is contained in:
parent
8bd687eb21
commit
0356c5ca54
@ -27,7 +27,7 @@
|
||||
|
||||
#include <xcb/xproto.h>
|
||||
|
||||
#define IconSize 16
|
||||
#define IconSize 20
|
||||
|
||||
const QStringList ItemCategoryList {"ApplicationStatus", "Communications", "SystemServices", "Hardware"};
|
||||
const QStringList ItemStatusList {"Passive", "Active", "NeedsAttention"};
|
||||
@ -346,7 +346,9 @@ void SNITrayWidget::showContextMenu(int x, int y)
|
||||
qDebug() << "context menu has not be ready, init menu";
|
||||
initMenu();
|
||||
}
|
||||
m_menu->popup(QPoint(x, y));
|
||||
|
||||
if (m_menu)
|
||||
m_menu->popup(QPoint(x, y));
|
||||
}
|
||||
hidePopup();
|
||||
}
|
||||
|
@ -407,6 +407,9 @@ void TrayPlugin::traySNIAdded(const QString &itemKey, const QString &sniServiceP
|
||||
}
|
||||
|
||||
SNITrayWidget *trayWidget = new SNITrayWidget(sniServicePath);
|
||||
if (!trayWidget->isValid())
|
||||
return;
|
||||
|
||||
if (trayWidget->status() == SNITrayWidget::ItemStatus::Passive) {
|
||||
m_passiveSNITrayMap.insert(itemKey, trayWidget);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user