mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
update app item timeline settings
Change-Id: Idb252f1928b8789cccf779695789c93b98b4620a
This commit is contained in:
parent
9589b2c996
commit
d0c38bccc4
Notes:
gerrit
2018-03-19 03:37:00 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Mon, 19 Mar 2018 03:36:59 +0000 Reviewed-on: https://cr.deepin.io/32765 Project: dde/dde-dock Branch: refs/heads/master
@ -176,6 +176,8 @@ AppItem::AppItem(const QDBusObjectPath &entry, QWidget *parent)
|
||||
|
||||
AppItem::~AppItem()
|
||||
{
|
||||
stopSwingEffect();
|
||||
|
||||
m_appNameTips->deleteLater();
|
||||
m_appPreviewTips->deleteLater();
|
||||
}
|
||||
@ -529,8 +531,7 @@ void AppItem::updateWindowInfos(const WindowInfoMap &info)
|
||||
if (DockDisplayMode == DisplayMode::Fashion)
|
||||
playSwingEffect();
|
||||
} else {
|
||||
// stop swing effect
|
||||
m_swingEffectView->setVisible(false);
|
||||
stopSwingEffect();
|
||||
}
|
||||
|
||||
update();
|
||||
@ -589,11 +590,9 @@ void AppItem::cancelAndHidePreview()
|
||||
|
||||
void AppItem::playSwingEffect()
|
||||
{
|
||||
if (m_itemAnimation.timeLine())
|
||||
stopSwingEffect();
|
||||
if (!m_itemAnimation.timeLine())
|
||||
{
|
||||
m_itemAnimation.timeLine()->stop();
|
||||
m_itemAnimation.clear();
|
||||
} else {
|
||||
QTimeLine *tl = new QTimeLine(1200, this);
|
||||
tl->setFrameRange(0, 60);
|
||||
tl->setLoopCount(1);
|
||||
@ -603,8 +602,6 @@ void AppItem::playSwingEffect()
|
||||
m_itemAnimation.setTimeLine(tl);
|
||||
}
|
||||
|
||||
m_itemScene->clear();
|
||||
|
||||
const auto ratio = qApp->devicePixelRatio();
|
||||
const QRect r = rect();
|
||||
const QPixmap &icon = m_appIcon;
|
||||
@ -636,6 +633,17 @@ void AppItem::playSwingEffect()
|
||||
m_swingEffectView->setVisible(true);
|
||||
}
|
||||
|
||||
void AppItem::stopSwingEffect()
|
||||
{
|
||||
// stop swing effect
|
||||
m_swingEffectView->setVisible(false);
|
||||
|
||||
if (m_itemAnimation.timeLine())
|
||||
m_itemAnimation.timeLine()->stop();
|
||||
m_itemAnimation.clear();
|
||||
m_itemScene->clear();
|
||||
}
|
||||
|
||||
void AppItem::checkAttentionEffect()
|
||||
{
|
||||
QTimer::singleShot(1000, this, [=] {
|
||||
|
@ -84,6 +84,7 @@ private slots:
|
||||
void showPreview();
|
||||
void cancelAndHidePreview();
|
||||
void playSwingEffect();
|
||||
void stopSwingEffect();
|
||||
void checkAttentionEffect();
|
||||
|
||||
private:
|
||||
|
@ -123,7 +123,7 @@ bool DockPopupWindow::eventFilter(QObject *o, QEvent *e)
|
||||
|
||||
// FIXME: ensure position move after global mouse release event
|
||||
if (isVisible())
|
||||
QTimer::singleShot(0, this, [=] { show(m_lastPoint, m_model); });
|
||||
QTimer::singleShot(10, this, [=] { show(m_lastPoint, m_model); });
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -322,6 +322,7 @@ void MainWindow::internalMove(const QPoint &p)
|
||||
}
|
||||
}
|
||||
|
||||
// using platform window to set real window position
|
||||
windowHandle()->handle()->setGeometry(QRect(rp.x(), rp.y(), wx, hx));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user