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-181945.html Change-Id: Idcef18077d9f822b2ea3aca93442a2d098ea146b
This commit is contained in:
parent
a1748e3ca1
commit
f7812cfb66
@ -89,6 +89,12 @@ void DockPopupWindow::setContent(QWidget *content)
|
||||
void DockPopupWindow::setExtendWidget(QWidget *widget)
|
||||
{
|
||||
m_extendWidget = widget;
|
||||
connect(widget, &QWidget::destroyed, this, [ this ] { m_extendWidget = nullptr; }, Qt::UniqueConnection);
|
||||
}
|
||||
|
||||
QWidget *DockPopupWindow::extengWidget() const
|
||||
{
|
||||
return m_extendWidget;
|
||||
}
|
||||
|
||||
void DockPopupWindow::show(const QPoint &pos, const bool model)
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
|
||||
void setContent(QWidget *content);
|
||||
void setExtendWidget(QWidget *widget);
|
||||
QWidget *extengWidget() const;
|
||||
|
||||
public slots:
|
||||
void show(const QPoint &pos, const bool model = false);
|
||||
|
@ -359,6 +359,12 @@ void QuickPluginWindow::onRequestUpdate()
|
||||
// 如果该插件在任务栏上,则先将其添加到临时列表中
|
||||
pluginItems[dockItem->pluginItem()] = dockItem;
|
||||
} else {
|
||||
DockPopupWindow *popupWindow = getPopWindow();
|
||||
if (popupWindow->isVisible()) {
|
||||
// 该插件被移除的情况下,判断弹出窗口是否在当前的插件中打开的,如果是,则隐藏该窗口
|
||||
if (popupWindow->extengWidget() == dockItem)
|
||||
popupWindow->hide();
|
||||
}
|
||||
// 如果该插件不在任务栏上,则先删除
|
||||
dockItem->deleteLater();
|
||||
countChanged = true;
|
||||
|
@ -64,6 +64,8 @@ void BluetoothPlugin::init(PluginProxyInterface *proxyInter)
|
||||
m_proxyInter->itemAdded(this, BLUETOOTH_KEY);
|
||||
});
|
||||
connect(m_bluetoothItem.data(), &BluetoothItem::noAdapter, [&] {
|
||||
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
|
||||
m_proxyInter->requestSetAppletVisible(this, BLUETOOTH_KEY, false);
|
||||
m_proxyInter->itemRemoved(this, BLUETOOTH_KEY);
|
||||
});
|
||||
connect(m_bluetoothWidget.data(), &BluetoothMainWidget::requestExpand, this, [ = ] {
|
||||
|
Loading…
x
Reference in New Issue
Block a user