mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
disable shadow effect
Change-Id: I9903bd013a764ff3b6f790f6bd7e2ccdf50ef93f
This commit is contained in:
parent
e6d5687356
commit
7cdec93fb9
Notes:
Deepin Code Review
2018-01-04 18:21:31 +08:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Thu, 04 Jan 2018 18:21:30 +0800 Reviewed-on: https://cr.deepin.io/30017 Project: dde/dde-dock Branch: refs/heads/master
@ -44,39 +44,18 @@ MainPanel::MainPanel(QWidget *parent)
|
|||||||
|
|
||||||
setBlurRectXRadius(0);
|
setBlurRectXRadius(0);
|
||||||
setBlurRectYRadius(0);
|
setBlurRectYRadius(0);
|
||||||
setMaskColor(QColor(0, 0, 0, 255 * 0.2));
|
setMaskColor(QColor(0, 0, 0, 255 * 0.4));
|
||||||
setBlendMode(BehindWindowBlend);
|
setBlendMode(BehindWindowBlend);
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
setAccessibleName("dock-mainpanel");
|
setAccessibleName("dock-mainpanel");
|
||||||
setObjectName("MainPanel");
|
setObjectName("MainPanel");
|
||||||
setStyleSheet("QWidget #MainPanel {"
|
setStyleSheet("QWidget #MainPanel {"
|
||||||
// "border:" xstr(PANEL_BORDER) "px solid rgba(162, 162, 162, .2);"
|
|
||||||
// "background-color:rgba(10, 10, 10, .6);"
|
// "background-color:rgba(10, 10, 10, .6);"
|
||||||
"}"
|
"}"
|
||||||
"QWidget #MainPanel[displayMode='1'] {"
|
// "QWidget #MainPanel[displayMode='1'] {"
|
||||||
"border:none;"
|
// "border:none;"
|
||||||
"}"
|
// "}"
|
||||||
// Top
|
|
||||||
"QWidget #MainPanel[displayMode='0'][position='0'] {"
|
|
||||||
// "border-bottom-left-radius:5px;"
|
|
||||||
// "border-bottom-right-radius:5px;"
|
|
||||||
"}"
|
|
||||||
// Right
|
|
||||||
"QWidget #MainPanel[displayMode='0'][position='1'] {"
|
|
||||||
// "border-top-left-radius:5px;"
|
|
||||||
// "border-bottom-left-radius:5px;"
|
|
||||||
"}"
|
|
||||||
// Bottom
|
|
||||||
"QWidget #MainPanel[displayMode='0'][position='2'] {"
|
|
||||||
// "border-top-left-radius:6px;"
|
|
||||||
// "border-top-right-radius:6px;"
|
|
||||||
"}"
|
|
||||||
// Left
|
|
||||||
"QWidget #MainPanel[displayMode='0'][position='3'] {"
|
|
||||||
// "border-top-right-radius:5px;"
|
|
||||||
// "border-bottom-right-radius:5px;"
|
|
||||||
"}"
|
|
||||||
"QWidget #MainPanel[position='0'] {"
|
"QWidget #MainPanel[position='0'] {"
|
||||||
"padding:0 " xstr(PANEL_PADDING) "px;"
|
"padding:0 " xstr(PANEL_PADDING) "px;"
|
||||||
"border-top:none;"
|
"border-top:none;"
|
||||||
|
@ -130,7 +130,7 @@ DockSettings::DockSettings(QWidget *parent)
|
|||||||
connect(&m_settingsMenu, &WhiteMenu::triggered, this, &DockSettings::menuActionClicked);
|
connect(&m_settingsMenu, &WhiteMenu::triggered, this, &DockSettings::menuActionClicked);
|
||||||
connect(m_dockInter, &DBusDock::PositionChanged, this, &DockSettings::onPositionChanged);
|
connect(m_dockInter, &DBusDock::PositionChanged, this, &DockSettings::onPositionChanged);
|
||||||
connect(m_dockInter, &DBusDock::IconSizeChanged, this, &DockSettings::iconSizeChanged);
|
connect(m_dockInter, &DBusDock::IconSizeChanged, this, &DockSettings::iconSizeChanged);
|
||||||
connect(m_dockInter, &DBusDock::DisplayModeChanged, this, &DockSettings::displayModeChanged);
|
connect(m_dockInter, &DBusDock::DisplayModeChanged, this, &DockSettings::onDisplayModeChanged);
|
||||||
connect(m_dockInter, &DBusDock::HideModeChanged, this, &DockSettings::hideModeChanged, Qt::QueuedConnection);
|
connect(m_dockInter, &DBusDock::HideModeChanged, this, &DockSettings::hideModeChanged, Qt::QueuedConnection);
|
||||||
connect(m_dockInter, &DBusDock::HideStateChanged, this, &DockSettings::hideStateChanged);
|
connect(m_dockInter, &DBusDock::HideStateChanged, this, &DockSettings::hideStateChanged);
|
||||||
connect(m_dockInter, &DBusDock::ServiceRestarted, this, &DockSettings::resetFrontendGeometry);
|
connect(m_dockInter, &DBusDock::ServiceRestarted, this, &DockSettings::resetFrontendGeometry);
|
||||||
@ -313,15 +313,17 @@ void DockSettings::onPositionChanged()
|
|||||||
if (prevPos == nextPos)
|
if (prevPos == nextPos)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_position = nextPos;
|
|
||||||
DockItem::setDockPosition(m_position);
|
|
||||||
qApp->setProperty(PROP_POSITION, QVariant::fromValue(m_position));
|
|
||||||
|
|
||||||
calculateWindowConfig();
|
|
||||||
|
|
||||||
emit positionChanged(prevPos);
|
emit positionChanged(prevPos);
|
||||||
|
|
||||||
m_itemController->refershItemsIcon();
|
QTimer::singleShot(200, this, [=] {
|
||||||
|
m_position = nextPos;
|
||||||
|
DockItem::setDockPosition(m_position);
|
||||||
|
qApp->setProperty(PROP_POSITION, QVariant::fromValue(m_position));
|
||||||
|
|
||||||
|
calculateWindowConfig();
|
||||||
|
|
||||||
|
m_itemController->refershItemsIcon();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockSettings::iconSizeChanged()
|
void DockSettings::iconSizeChanged()
|
||||||
@ -335,7 +337,7 @@ void DockSettings::iconSizeChanged()
|
|||||||
emit dataChanged();
|
emit dataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockSettings::displayModeChanged()
|
void DockSettings::onDisplayModeChanged()
|
||||||
{
|
{
|
||||||
// qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
m_displayMode = Dock::DisplayMode(m_dockInter->displayMode());
|
m_displayMode = Dock::DisplayMode(m_dockInter->displayMode());
|
||||||
@ -345,6 +347,7 @@ void DockSettings::displayModeChanged()
|
|||||||
calculateWindowConfig();
|
calculateWindowConfig();
|
||||||
|
|
||||||
emit dataChanged();
|
emit dataChanged();
|
||||||
|
emit displayModeChanegd();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DockSettings::hideModeChanged()
|
void DockSettings::hideModeChanged()
|
||||||
|
@ -84,6 +84,7 @@ signals:
|
|||||||
void dataChanged() const;
|
void dataChanged() const;
|
||||||
void positionChanged(const Position prevPosition) const;
|
void positionChanged(const Position prevPosition) const;
|
||||||
void autoHideChanged(const bool autoHide) const;
|
void autoHideChanged(const bool autoHide) const;
|
||||||
|
void displayModeChanegd() const;
|
||||||
void windowVisibleChanged() const;
|
void windowVisibleChanged() const;
|
||||||
void windowHideModeChanged() const;
|
void windowHideModeChanged() const;
|
||||||
void windowGeometryChanged() const;
|
void windowGeometryChanged() const;
|
||||||
@ -96,7 +97,7 @@ private slots:
|
|||||||
void menuActionClicked(QAction *action);
|
void menuActionClicked(QAction *action);
|
||||||
void onPositionChanged();
|
void onPositionChanged();
|
||||||
void iconSizeChanged();
|
void iconSizeChanged();
|
||||||
void displayModeChanged();
|
void onDisplayModeChanged();
|
||||||
void hideModeChanged();
|
void hideModeChanged();
|
||||||
void hideStateChanged();
|
void hideStateChanged();
|
||||||
void dockItemCountChanged();
|
void dockItemCountChanged();
|
||||||
|
@ -333,6 +333,7 @@ void MainWindow::initConnections()
|
|||||||
connect(m_panelHideAni, &QPropertyAnimation::finished, this, &MainWindow::updateGeometry, Qt::QueuedConnection);
|
connect(m_panelHideAni, &QPropertyAnimation::finished, this, &MainWindow::updateGeometry, Qt::QueuedConnection);
|
||||||
connect(m_panelHideAni, &QPropertyAnimation::finished, m_shadowMaskOptimizeTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
connect(m_panelHideAni, &QPropertyAnimation::finished, m_shadowMaskOptimizeTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||||
connect(m_panelShowAni, &QPropertyAnimation::finished, m_shadowMaskOptimizeTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
connect(m_panelShowAni, &QPropertyAnimation::finished, m_shadowMaskOptimizeTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||||
|
connect(m_settings, &DockSettings::displayModeChanegd, m_shadowMaskOptimizeTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
|
||||||
connect(m_posChangeAni, &QVariantAnimation::valueChanged, this, static_cast<void (MainWindow::*)()>(&MainWindow::internalMove));
|
connect(m_posChangeAni, &QVariantAnimation::valueChanged, this, static_cast<void (MainWindow::*)()>(&MainWindow::internalMove));
|
||||||
connect(m_posChangeAni, &QVariantAnimation::finished, this, static_cast<void (MainWindow::*)()>(&MainWindow::internalMove), Qt::QueuedConnection);
|
connect(m_posChangeAni, &QVariantAnimation::finished, this, static_cast<void (MainWindow::*)()>(&MainWindow::internalMove), Qt::QueuedConnection);
|
||||||
|
|
||||||
@ -386,7 +387,7 @@ void MainWindow::positionChanged(const Position prevPos)
|
|||||||
narrow(prevPos);
|
narrow(prevPos);
|
||||||
|
|
||||||
// reset position & layout and slide out
|
// reset position & layout and slide out
|
||||||
QTimer::singleShot(100, this, [&] {
|
QTimer::singleShot(200, this, [&] {
|
||||||
resetPanelEnvironment(false, true);
|
resetPanelEnvironment(false, true);
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
expand();
|
expand();
|
||||||
@ -680,11 +681,12 @@ void MainWindow::adjustShadowMask()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const bool composite = m_wmHelper->hasComposite();
|
const bool composite = m_wmHelper->hasComposite();
|
||||||
const bool animationRunning = m_panelShowAni->state() == QPropertyAnimation::Running ||
|
const bool isFasion = m_settings->displayMode() == Fashion;
|
||||||
m_panelHideAni->state() == QPropertyAnimation::Running;
|
// const bool animationRunning = m_panelShowAni->state() == QPropertyAnimation::Running ||
|
||||||
|
// m_panelHideAni->state() == QPropertyAnimation::Running;
|
||||||
|
|
||||||
m_platformWindowHandle.setWindowRadius(composite ? 5 : 0);
|
m_platformWindowHandle.setWindowRadius(composite && isFasion ? 5 : 0);
|
||||||
m_platformWindowHandle.setShadowRadius(!animationRunning && composite ? 60 : 0);
|
// m_platformWindowHandle.setShadowRadius(!animationRunning && composite ? 60 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::positionCheck()
|
void MainWindow::positionCheck()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user