From aa0f599124db8ed6de78bcc11a8951ea0916679d Mon Sep 17 00:00:00 2001 From: chenjun Date: Wed, 5 Aug 2020 18:11:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=B8=8D=E4=BD=BF=E7=94=A8=E6=B0=B4=E5=B9=B3=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=98=BE=E7=A4=BA=EF=BC=8C=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E4=BD=8D=E7=BD=AE=E5=9C=A8=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关闭按钮和应用程序标题使用的水平布局显示,当鼠标进入提示窗口时,显示关闭按钮,应用标题会向左缩放,造成文字偏左,因此关闭按钮不使用水平布局显示, 当需要显示关闭按钮时,实时计算按钮位置,在右侧显示 Log: 修复2D模式下,鼠标hover在预览信息上,文字会移动到信息边框的最左边问题 Bug: https://pms.uniontech.com/zentao/bug-view-41363.html Change-Id: I6d6fe44c021639813b7ec73b648a82203ff10551 Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/1343 Tested-by: lizhongming Reviewed-by: lizhongming Reviewed-by: niecheng --- frame/item/components/appsnapshot.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index f7011a8b3..f6c58725d 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -74,12 +74,8 @@ AppSnapshot::AppSnapshot(const WId wid, QWidget *parent) QHBoxLayout *centralLayout = new QHBoxLayout; centralLayout->addWidget(m_title); - centralLayout->addWidget(m_closeBtn2D); - centralLayout->setSpacing(5); centralLayout->setMargin(0); - centralLayout->setAlignment(m_closeBtn2D, Qt::AlignRight); - setLayout(centralLayout); setAcceptDrops(true); resize(SNAP_WIDTH, SNAP_HEIGHT); @@ -202,6 +198,7 @@ void AppSnapshot::enterEvent(QEvent *e) QWidget::enterEvent(e); if (!m_wmHelper->hasComposite()) { + m_closeBtn2D->move(width() - m_closeBtn2D->width() - 5, (height() - m_closeBtn2D->height()) / 2); m_closeBtn2D->setVisible(true); } else { emit entered(wid());