From de9d69db1f15f7aade6794463ea906ae23ff4635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=8D=9A=E6=96=87?= Date: Thu, 28 Dec 2017 16:57:49 +0800 Subject: [PATCH] fix close icon disappear Change-Id: I29366a69811b4cd269e473f480ea74887969a7dc --- frame/item/components/appsnapshot.cpp | 8 ++++---- frame/item/components/floatingpreview.cpp | 2 +- frame/item/components/previewcontainer.cpp | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index 6ce530214..00b045dbd 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -42,9 +42,9 @@ AppSnapshot::AppSnapshot(const WId wid, QWidget *parent) m_wmHelper(DWindowManagerHelper::instance()) { m_closeBtn->setFixedSize(24, 24); - m_closeBtn->setNormalPic(":/icons/resources/close_round_normal.png"); - m_closeBtn->setHoverPic(":/icons/resources/close_round_hover.png"); - m_closeBtn->setPressPic(":/icons/resources/close_round_press.png"); + m_closeBtn->setNormalPic(":/icons/resources/close_round_normal.svg"); + m_closeBtn->setHoverPic(":/icons/resources/close_round_hover.svg"); + m_closeBtn->setPressPic(":/icons/resources/close_round_press.svg"); m_closeBtn->setVisible(false); QHBoxLayout *centralLayout = new QHBoxLayout; @@ -55,7 +55,7 @@ AppSnapshot::AppSnapshot(const WId wid, QWidget *parent) setLayout(centralLayout); setAcceptDrops(true); - setFixedSize(SNAP_WIDTH, SNAP_HEIGHT); + resize(SNAP_WIDTH, SNAP_HEIGHT); connect(m_closeBtn, &DImageButton::clicked, this, &AppSnapshot::closeWindow, Qt::QueuedConnection); connect(m_wmHelper, &DWindowManagerHelper::hasCompositeChanged, this, &AppSnapshot::compositeChanged, Qt::QueuedConnection); diff --git a/frame/item/components/floatingpreview.cpp b/frame/item/components/floatingpreview.cpp index e58063d81..a7888177c 100644 --- a/frame/item/components/floatingpreview.cpp +++ b/frame/item/components/floatingpreview.cpp @@ -76,7 +76,7 @@ void FloatingPreview::paintEvent(QPaintEvent *e) if (m_tracked.isNull()) return; - const QImage snapshot = m_tracked->snapshot(); + const QImage &snapshot = m_tracked->snapshot(); if (snapshot.isNull()) return; diff --git a/frame/item/components/previewcontainer.cpp b/frame/item/components/previewcontainer.cpp index c669ffd25..0cf9201c4 100644 --- a/frame/item/components/previewcontainer.cpp +++ b/frame/item/components/previewcontainer.cpp @@ -79,7 +79,8 @@ void PreviewContainer::setWindowInfos(const WindowDict &infos) if (m_snapshots.isEmpty()) emit requestCancelAndHidePreview(); - adjustSize(); + + adjustSize(); } void PreviewContainer::updateSnapshots()