Fix app window snapshot size error

Change-Id: I2a576454562536808fcf1b788a5cebf151a986d0
This commit is contained in:
石博文 2018-02-22 17:19:55 +08:00
parent b57f8f8328
commit 67b7ef44f5
Notes: Deepin Code Review 2018-02-23 11:38:19 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Fri, 23 Feb 2018 11:38:18 +0800
Reviewed-on: https://cr.deepin.io/31816
Project: dde/dde-dock
Branch: refs/heads/master
3 changed files with 12 additions and 2 deletions

View File

@ -616,11 +616,11 @@ void AppItem::showPreview()
// default: return;
// }
showPopupWindow(m_appPreviewTips, true);
m_appPreviewTips->setWindowInfos(m_windowInfos);
m_appPreviewTips->updateSnapshots();
m_appPreviewTips->updateLayoutDirection(DockPosition);
showPopupWindow(m_appPreviewTips, true);
}
void AppItem::cancelAndHidePreview()

View File

@ -87,6 +87,8 @@ void AppSnapshot::compositeChanged() const
const bool composite = m_wmHelper->hasComposite();
m_title->setVisible(!composite);
QTimer::singleShot(1, this, &AppSnapshot::fetchSnapshot);
}
void AppSnapshot::setWindowInfo(const WindowInfo &info)
@ -214,6 +216,13 @@ void AppSnapshot::paintEvent(QPaintEvent *e)
painter.drawImage(offset_x, offset_y, im);
}
void AppSnapshot::resizeEvent(QResizeEvent *e)
{
QWidget::resizeEvent(e);
QTimer::singleShot(1, this, &AppSnapshot::fetchSnapshot);
}
void AppSnapshot::mousePressEvent(QMouseEvent *e)
{
QWidget::mousePressEvent(e);

View File

@ -65,6 +65,7 @@ private:
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
void paintEvent(QPaintEvent *e);
void resizeEvent(QResizeEvent *e);
void mousePressEvent(QMouseEvent *e);
private: