mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
optimize background blur effect
Change-Id: Ie42f6090f20710c7d20cf832c508f82b56aa57b1
This commit is contained in:
parent
c55cf19ac5
commit
568ffb10ca
Notes:
Deepin Code Review
2017-02-17 14:23:49 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Fri, 17 Feb 2017 14:23:49 +0800 Reviewed-on: https://cr.deepin.io/20345 Project: dde/dde-dock Branch: refs/heads/master
@ -87,7 +87,7 @@ MainPanel::MainPanel(QWidget *parent)
|
||||
m_itemAdjustTimer->setInterval(100);
|
||||
|
||||
m_updateEffectTimer->setSingleShot(true);
|
||||
m_updateEffectTimer->setInterval(100);
|
||||
m_updateEffectTimer->setInterval(10);
|
||||
|
||||
const QList<DockItem *> itemList = m_itemController->itemList();
|
||||
for (auto item : itemList)
|
||||
@ -351,16 +351,17 @@ DockItem *MainPanel::itemAt(const QPoint &point)
|
||||
|
||||
void MainPanel::updateBlurEffect() const
|
||||
{
|
||||
qDebug() << m_position;
|
||||
if (m_displayMode == Efficient) {
|
||||
m_effectWidget->setBlurRectXRadius(0);
|
||||
m_effectWidget->setBlurRectYRadius(0);
|
||||
m_effectWidget->move(0, 0);
|
||||
m_effectWidget->move(pos());
|
||||
m_effectWidget->resize(size());
|
||||
} else {
|
||||
const int expandSize = 10;
|
||||
int width = this->width();
|
||||
int height = this->height();
|
||||
const int x = pos().x();
|
||||
const int y = pos().y();
|
||||
|
||||
m_effectWidget->setBlurRectXRadius(5);
|
||||
m_effectWidget->setBlurRectYRadius(5);
|
||||
@ -369,24 +370,24 @@ void MainPanel::updateBlurEffect() const
|
||||
{
|
||||
case Top: {
|
||||
height += expandSize;
|
||||
m_effectWidget->move(0, -expandSize);
|
||||
m_effectWidget->move(x, y - expandSize);
|
||||
m_effectWidget->resize(width, height);
|
||||
break;
|
||||
}
|
||||
case Bottom:
|
||||
height += expandSize;
|
||||
m_effectWidget->move(0, 0);
|
||||
m_effectWidget->move(x, y);
|
||||
m_effectWidget->resize(width, height);
|
||||
break;
|
||||
case Left: {
|
||||
width += expandSize;
|
||||
m_effectWidget->move(-expandSize, 0);
|
||||
m_effectWidget->move(x - expandSize, y);
|
||||
m_effectWidget->resize(width, height);
|
||||
break;
|
||||
}
|
||||
case Right: {
|
||||
width += expandSize;
|
||||
m_effectWidget->move(0, 0);
|
||||
m_effectWidget->move(x, y);
|
||||
m_effectWidget->resize(width, height);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user