mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix:Do not drag when tray icon is deleted
托盘图标删除时取消拖拽状态 (task:13009)
This commit is contained in:
parent
660a740a05
commit
2f866675cc
@ -69,6 +69,9 @@ bool AbstractContainer::removeWrapper(FashionTrayWidgetWrapper *wrapper)
|
||||
if (!w->absTrayWidget().isNull())
|
||||
w->absTrayWidget()->setParent(nullptr);
|
||||
|
||||
if (w->isDragging()) {
|
||||
w->cancelDragging();
|
||||
}
|
||||
w->deleteLater();
|
||||
|
||||
refreshVisible();
|
||||
|
@ -265,3 +265,13 @@ void FashionTrayWidgetWrapper::setAttention(bool attention)
|
||||
|
||||
Q_EMIT attentionChanged(m_attention);
|
||||
}
|
||||
|
||||
bool FashionTrayWidgetWrapper::isDragging()
|
||||
{
|
||||
return m_dragging;
|
||||
}
|
||||
|
||||
void FashionTrayWidgetWrapper::cancelDragging()
|
||||
{
|
||||
QDrag::cancel();
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
|
||||
bool attention() const;
|
||||
void setAttention(bool attention);
|
||||
bool isDragging();
|
||||
void cancelDragging();
|
||||
|
||||
Q_SIGNALS:
|
||||
void attentionChanged(const bool attention);
|
||||
|
Loading…
x
Reference in New Issue
Block a user