mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +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()
|
AppItem::~AppItem()
|
||||||
{
|
{
|
||||||
|
stopSwingEffect();
|
||||||
|
|
||||||
m_appNameTips->deleteLater();
|
m_appNameTips->deleteLater();
|
||||||
m_appPreviewTips->deleteLater();
|
m_appPreviewTips->deleteLater();
|
||||||
}
|
}
|
||||||
@ -529,8 +531,7 @@ void AppItem::updateWindowInfos(const WindowInfoMap &info)
|
|||||||
if (DockDisplayMode == DisplayMode::Fashion)
|
if (DockDisplayMode == DisplayMode::Fashion)
|
||||||
playSwingEffect();
|
playSwingEffect();
|
||||||
} else {
|
} else {
|
||||||
// stop swing effect
|
stopSwingEffect();
|
||||||
m_swingEffectView->setVisible(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update();
|
update();
|
||||||
@ -589,11 +590,9 @@ void AppItem::cancelAndHidePreview()
|
|||||||
|
|
||||||
void AppItem::playSwingEffect()
|
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);
|
QTimeLine *tl = new QTimeLine(1200, this);
|
||||||
tl->setFrameRange(0, 60);
|
tl->setFrameRange(0, 60);
|
||||||
tl->setLoopCount(1);
|
tl->setLoopCount(1);
|
||||||
@ -603,8 +602,6 @@ void AppItem::playSwingEffect()
|
|||||||
m_itemAnimation.setTimeLine(tl);
|
m_itemAnimation.setTimeLine(tl);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_itemScene->clear();
|
|
||||||
|
|
||||||
const auto ratio = qApp->devicePixelRatio();
|
const auto ratio = qApp->devicePixelRatio();
|
||||||
const QRect r = rect();
|
const QRect r = rect();
|
||||||
const QPixmap &icon = m_appIcon;
|
const QPixmap &icon = m_appIcon;
|
||||||
@ -636,6 +633,17 @@ void AppItem::playSwingEffect()
|
|||||||
m_swingEffectView->setVisible(true);
|
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()
|
void AppItem::checkAttentionEffect()
|
||||||
{
|
{
|
||||||
QTimer::singleShot(1000, this, [=] {
|
QTimer::singleShot(1000, this, [=] {
|
||||||
|
@ -84,6 +84,7 @@ private slots:
|
|||||||
void showPreview();
|
void showPreview();
|
||||||
void cancelAndHidePreview();
|
void cancelAndHidePreview();
|
||||||
void playSwingEffect();
|
void playSwingEffect();
|
||||||
|
void stopSwingEffect();
|
||||||
void checkAttentionEffect();
|
void checkAttentionEffect();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -123,7 +123,7 @@ bool DockPopupWindow::eventFilter(QObject *o, QEvent *e)
|
|||||||
|
|
||||||
// FIXME: ensure position move after global mouse release event
|
// FIXME: ensure position move after global mouse release event
|
||||||
if (isVisible())
|
if (isVisible())
|
||||||
QTimer::singleShot(0, this, [=] { show(m_lastPoint, m_model); });
|
QTimer::singleShot(10, this, [=] { show(m_lastPoint, m_model); });
|
||||||
|
|
||||||
return false;
|
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));
|
windowHandle()->handle()->setGeometry(QRect(rp.x(), rp.y(), wx, hx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user