mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
optimize effect on composite switched
Change-Id: I46932c778cef83c55ad8546e08e97b3a1b3859d2
This commit is contained in:
parent
ecb014c9ed
commit
b175bcf815
Notes:
Deepin Code Review
2018-01-12 15:19:16 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Fri, 12 Jan 2018 15:19:16 +0800 Reviewed-on: https://cr.deepin.io/30493 Project: dde/dde-dock Branch: refs/heads/master
@ -44,7 +44,6 @@ MainPanel::MainPanel(QWidget *parent)
|
||||
|
||||
setBlurRectXRadius(0);
|
||||
setBlurRectYRadius(0);
|
||||
setMaskColor(QColor(0, 0, 0, 255 * 0.4));
|
||||
setBlendMode(BehindWindowBlend);
|
||||
|
||||
setAcceptDrops(true);
|
||||
@ -155,6 +154,14 @@ int MainPanel::position() const
|
||||
return int(m_position);
|
||||
}
|
||||
|
||||
void MainPanel::setEffectEnabled(const bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
setMaskColor(QColor(0, 0, 0, 255 * 0.4));
|
||||
else
|
||||
setMaskColor(QColor(55, 63, 71));
|
||||
}
|
||||
|
||||
void MainPanel::moveEvent(QMoveEvent* e)
|
||||
{
|
||||
DBlurEffectWidget::moveEvent(e);
|
||||
|
@ -54,6 +54,8 @@ public:
|
||||
int displayMode() const;
|
||||
int position() const;
|
||||
|
||||
void setEffectEnabled(const bool enabled);
|
||||
|
||||
signals:
|
||||
void requestWindowAutoHide(const bool autoHide) const;
|
||||
void requestRefershWindowVisible() const;
|
||||
|
@ -260,14 +260,16 @@ void MainWindow::initComponents()
|
||||
|
||||
void MainWindow::compositeChanged()
|
||||
{
|
||||
const int duration = m_wmHelper->hasComposite() ? 300 : 0;
|
||||
const bool composite = m_wmHelper->hasComposite();
|
||||
const int duration = composite ? 300 : 0;
|
||||
|
||||
m_sizeChangeAni->setDuration(duration);
|
||||
m_posChangeAni->setDuration(duration);
|
||||
m_panelShowAni->setDuration(duration);
|
||||
m_panelHideAni->setDuration(duration);
|
||||
m_mainPanel->setEffectEnabled(composite);
|
||||
|
||||
m_positionUpdateTimer->start();
|
||||
m_shadowMaskOptimizeTimer->start();
|
||||
}
|
||||
|
||||
void MainWindow::internalMove(const QPoint &p)
|
||||
|
Loading…
x
Reference in New Issue
Block a user