fix close icon disappear

Change-Id: I29366a69811b4cd269e473f480ea74887969a7dc
This commit is contained in:
石博文 2017-12-28 16:57:49 +08:00
parent 35c8ad7215
commit de9d69db1f
Notes: Deepin Code Review 2017-12-28 17:05:06 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Thu, 28 Dec 2017 17:05:05 +0800
Reviewed-on: https://cr.deepin.io/29813
Project: dde/dde-dock
Branch: refs/heads/master
3 changed files with 7 additions and 6 deletions

View File

@ -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);

View File

@ -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;

View File

@ -79,7 +79,8 @@ void PreviewContainer::setWindowInfos(const WindowDict &infos)
if (m_snapshots.isEmpty())
emit requestCancelAndHidePreview();
adjustSize();
adjustSize();
}
void PreviewContainer::updateSnapshots()