mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 2D模式下,应用区域没有移除驻留提示
2D模式下拖动任务栏的图标,会有移除信息提示 Log: 2D模式下,应用区域没有移除驻留提示 Bug: https://pms.uniontech.com/zentao/bug-view-41285.html Change-Id: I0bcbe61cdf364f24c48fcd6ba083921c455f0e14 Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/2265 Reviewed-by: wangwei <wangwei@uniontech.com> Reviewed-by: niecheng <niecheng@uniontech.com> Reviewed-by: <mailman@uniontech.com> Tested-by: <mailman@uniontech.com>
This commit is contained in:
parent
a91557d053
commit
d60938ed33
@ -186,14 +186,23 @@ const QPoint AppDragWidget::topleftPoint() const
|
||||
const QPoint AppDragWidget::popupMarkPoint(Dock::Position pos)
|
||||
{
|
||||
QPoint p(topleftPoint());
|
||||
QRect r = rect();
|
||||
//关闭特效,原本的图标设置小,然后隐藏,需要手动设置大小保证tips位置正确
|
||||
if (!DWindowManagerHelper::instance()->hasComposite()) {
|
||||
r.setWidth(m_iconSize.width() + 3);
|
||||
r.setHeight(m_iconSize.height() + 3);
|
||||
}
|
||||
|
||||
const QRect r = rect();
|
||||
switch (pos) {
|
||||
case Top:
|
||||
p += QPoint(r.width() / 2, r.height());
|
||||
break;
|
||||
case Bottom:
|
||||
p += QPoint(r.width() / 2, 0);
|
||||
if (!DWindowManagerHelper::instance()->hasComposite()) {
|
||||
p += QPoint(0 , -r.height() / 2);
|
||||
} else {
|
||||
p += QPoint(r.width() / 2, 0);
|
||||
}
|
||||
break;
|
||||
case Left:
|
||||
p += QPoint(r.width(), r.height() / 2);
|
||||
@ -210,12 +219,20 @@ void AppDragWidget::dropEvent(QDropEvent *event)
|
||||
m_followMouseTimer->stop();
|
||||
|
||||
if (isRemoveAble()) {
|
||||
showRemoveAnimation();
|
||||
if (DWindowManagerHelper::instance()->hasComposite()) {
|
||||
showRemoveAnimation();
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
AppItem *appItem = static_cast<AppItem *>(event->source());
|
||||
appItem->undock();
|
||||
m_popupWindow->setVisible(false);
|
||||
} else {
|
||||
showGoBackAnimation();
|
||||
if (DWindowManagerHelper::instance()->hasComposite()) {
|
||||
showGoBackAnimation();
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,9 +243,14 @@ void AppDragWidget::hideEvent(QHideEvent *event)
|
||||
|
||||
void AppDragWidget::setAppPixmap(const QPixmap &pix)
|
||||
{
|
||||
// QSize(3, 3) to fix pixmap be cliped
|
||||
setFixedSize(pix.size() + QSize(3, 3));
|
||||
if (DWindowManagerHelper::instance()->hasComposite()) {
|
||||
// QSize(3, 3) to fix pixmap be cliped
|
||||
setFixedSize(pix.size() + QSize(3, 3));
|
||||
} else {
|
||||
setFixedSize(QSize(10, 10));
|
||||
}
|
||||
|
||||
m_iconSize = pix.size();
|
||||
m_object->setAppPixmap(pix);
|
||||
m_object->setTransformOriginPoint(pix.rect().center());
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ private:
|
||||
Dock::Position m_dockPosition;
|
||||
QRect m_dockGeometry;
|
||||
QPoint m_originPoint;
|
||||
QSize m_iconSize;
|
||||
Dock::TipsWidget *m_removeTips;
|
||||
DockPopupWindow *m_popupWindow;
|
||||
/**
|
||||
|
@ -683,18 +683,16 @@ void MainPanelControl::startDrag(DockItem *item)
|
||||
|
||||
appDrag->appDragWidget()->setOriginPos((m_appAreaSonWidget->mapToGlobal(item->pos())));
|
||||
appDrag->appDragWidget()->setDockInfo(m_position, QRect(mapToGlobal(pos()), size()));
|
||||
const QPixmap &dragPix = qobject_cast<AppItem *>(item)->appIcon();
|
||||
|
||||
appDrag->setPixmap(dragPix);
|
||||
m_appDragWidget->show();
|
||||
|
||||
if (DWindowManagerHelper::instance()->hasComposite()) {
|
||||
appDrag->setPixmap(pixmap);
|
||||
m_appDragWidget->show();
|
||||
|
||||
static_cast<QGraphicsView *>(m_appDragWidget)->viewport()->installEventFilter(this);
|
||||
} else {
|
||||
const QPixmap &dragPix = qobject_cast<AppItem *>(item)->appIcon();
|
||||
|
||||
appDrag->QDrag::setPixmap(dragPix);
|
||||
appDrag->setHotSpot(dragPix.rect().center() / dragPix.devicePixelRatioF());
|
||||
}
|
||||
}
|
||||
|
||||
drag = appDrag;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user