mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: tray strange fold animation when dock size is maxied
Change-Id: I5511443b51f7a473d7a5b2ee6f9de4b544eea480
This commit is contained in:
parent
7354cf5166
commit
57f5e5c75c
Notes:
gerrit
2018-11-23 08:57:28 +08:00
Verified+1: <jenkins@deepin.com> Code-Review+2: listenerri <listenerri@gmail.com> Submitted-by: listenerri <listenerri@gmail.com> Submitted-at: Fri, 23 Nov 2018 08:57:28 +0800 Reviewed-on: https://cr.deepin.io/39986 Project: dde/dde-dock Branch: refs/heads/master
@ -594,22 +594,25 @@ void DockSettings::calculateWindowConfig()
|
||||
switch (m_position)
|
||||
{
|
||||
case Top:
|
||||
case Bottom:
|
||||
case Bottom: {
|
||||
m_mainWindowSize.setHeight(defaultHeight + PANEL_BORDER);
|
||||
m_mainWindowSize.setWidth(calcWidth);
|
||||
m_isMaxSize = (calcWidth == maxWidth);
|
||||
break;
|
||||
|
||||
}
|
||||
case Left:
|
||||
case Right:
|
||||
case Right: {
|
||||
m_mainWindowSize.setHeight(calcHeight);
|
||||
m_mainWindowSize.setWidth(defaultWidth + PANEL_BORDER);
|
||||
m_isMaxSize = (calcHeight == maxHeight);
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
||||
// used by FashionTrayItem of TrayPlugin
|
||||
qApp->setProperty("DockIsMaxiedSize", m_isMaxSize);
|
||||
} else {
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
@ -192,8 +192,14 @@ void FashionTrayItem::onTrayListExpandChanged(const bool expand)
|
||||
if (expand) {
|
||||
refreshTraysVisible();
|
||||
} else {
|
||||
// hide all tray widget delay for fold animation
|
||||
QTimer::singleShot(350, this, [=] {refreshTraysVisible();});
|
||||
// hide all tray immediately if Dock is in maxed size
|
||||
// the property "DockIsMaxiedSize" of qApp is set by DockSettings class
|
||||
if (qApp->property("DockIsMaxiedSize").toBool()) {
|
||||
refreshTraysVisible();
|
||||
} else {
|
||||
// hide all tray widget delay for fold animation
|
||||
QTimer::singleShot(350, this, [=] {refreshTraysVisible();});
|
||||
}
|
||||
requestResize();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user