mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: 点击图标范围内时才能对图标进行拖动
拖动任务栏插件或托盘图标时,根据图标大小,计算点击区域是否为有效区域 Log: 修复任务栏插件区域的触控区域比鼠标点击的范围更大问题 Bug: https://pms.uniontech.com/zentao/bug-view-45282.html Change-Id: If5cbb131e1115f10bd054f8926b2f35d209c62dd Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/3170 Reviewed-by: <mailman@uniontech.com> Reviewed-by: lizhongming <lizhongming@uniontech.com> Tested-by: <mailman@uniontech.com>
This commit is contained in:
parent
ee2e60bbb7
commit
5b99caf67c
@ -60,6 +60,7 @@ public:
|
||||
|
||||
QSize sizeHint() const override;
|
||||
virtual QString accessibleName();
|
||||
bool containCursorPos();
|
||||
|
||||
public slots:
|
||||
virtual void refershIcon() {}
|
||||
@ -101,7 +102,6 @@ protected:
|
||||
protected slots:
|
||||
void showContextMenu();
|
||||
void onContextMenuAccepted();
|
||||
bool containCursorPos();
|
||||
|
||||
private:
|
||||
void updatePopupPosition();
|
||||
|
@ -164,6 +164,10 @@ void PluginsItem::mouseMoveEvent(QMouseEvent *e)
|
||||
|
||||
DockItem::mouseMoveEvent(e);
|
||||
|
||||
if (!containCursorPos()) {
|
||||
return;
|
||||
}
|
||||
|
||||
e->accept();
|
||||
|
||||
const QPoint distance = e->pos() - MousePressPoint;
|
||||
|
@ -611,6 +611,10 @@ bool MainPanelControl::eventFilter(QObject *watched, QEvent *event)
|
||||
if (item->itemType() != DockItem::App && item->itemType() != DockItem::Plugins && item->itemType() != DockItem::FixedPlugin)
|
||||
return false;
|
||||
|
||||
if (!item->containCursorPos()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const QPoint pos = mouseEvent->globalPos();
|
||||
const QPoint distance = pos - m_mousePressPos;
|
||||
if (distance.manhattanLength() < QApplication::startDragDistance())
|
||||
|
@ -244,6 +244,10 @@ void FashionTrayWidgetWrapper::handleMouseMove(QMouseEvent *event)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!containCursorPos()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event->accept();
|
||||
|
||||
QDrag drag(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user