mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix:Do not drag when dock icon is deleted
任务栏图标删除时取消拖拽状态 (task:13009)
This commit is contained in:
parent
2f866675cc
commit
ba695a3fc5
@ -223,6 +223,10 @@ void DockItemManager::appItemRemoved(AppItem *appItem)
|
||||
{
|
||||
emit itemRemoved(appItem);
|
||||
m_itemList.removeOne(appItem);
|
||||
|
||||
if (appItem->isDragging()) {
|
||||
QDrag::cancel();
|
||||
}
|
||||
appItem->deleteLater();
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QDrag>
|
||||
|
||||
DockPluginsController::DockPluginsController(QObject *parent)
|
||||
: AbstractPluginsController(parent)
|
||||
@ -85,6 +86,10 @@ void DockPluginsController::itemRemoved(PluginsItemInterface *const itemInter, c
|
||||
// do not delete the itemWidget object(specified in the plugin interface)
|
||||
item->centralWidget()->setParent(nullptr);
|
||||
|
||||
if (item->isDragging()) {
|
||||
QDrag::cancel();
|
||||
}
|
||||
|
||||
// just delete our wrapper object(PluginsItem)
|
||||
item->deleteLater();
|
||||
}
|
||||
|
@ -432,3 +432,8 @@ void DockItem::hideNonModel()
|
||||
if (m_popupShown && !PopupWindow->model())
|
||||
hidePopup();
|
||||
}
|
||||
|
||||
bool DockItem::isDragging()
|
||||
{
|
||||
return m_draging;
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ public slots:
|
||||
void hidePopup();
|
||||
virtual void setDraging(bool bDrag);
|
||||
|
||||
bool isDragging();
|
||||
signals:
|
||||
void dragStarted() const;
|
||||
void itemDropped(QObject *destination, const QPoint &dropPoint) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user