mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fixed(dock): fix bug 2697
This commit is contained in:
parent
3cfbc502f0
commit
212103100b
@ -171,14 +171,6 @@ const QSize DockSettings::panelSize() const
|
|||||||
const QRect DockSettings::windowRect(const Position position, const bool hide) const
|
const QRect DockSettings::windowRect(const Position position, const bool hide) const
|
||||||
{
|
{
|
||||||
QSize size = m_mainWindowSize;
|
QSize size = m_mainWindowSize;
|
||||||
if (hide) {
|
|
||||||
switch (position) {
|
|
||||||
case Top:
|
|
||||||
case Bottom: size.setHeight(2); break;
|
|
||||||
case Left:
|
|
||||||
case Right: size.setWidth(2); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const QRect primaryRect = this->primaryRect();
|
const QRect primaryRect = this->primaryRect();
|
||||||
const int offsetX = (primaryRect.width() - size.width()) / 2;
|
const int offsetX = (primaryRect.width() - size.width()) / 2;
|
||||||
|
@ -501,25 +501,15 @@ void MainWindow::updateGeometry()
|
|||||||
m_mainPanel->setPositonValue(position);
|
m_mainPanel->setPositonValue(position);
|
||||||
resizeMainPanelWindow();
|
resizeMainPanelWindow();
|
||||||
|
|
||||||
bool animation = true;
|
const QRect windowRect = m_settings->windowRect(position, true);
|
||||||
bool isHide = m_settings->hideState() == Hide && !testAttribute(Qt::WA_UnderMouse);
|
|
||||||
|
|
||||||
if (isHide) {
|
|
||||||
switch (position) {
|
|
||||||
case Top:
|
|
||||||
case Bottom: size.setHeight(2); break;
|
|
||||||
case Left:
|
|
||||||
case Right: size.setWidth(2); break;
|
|
||||||
}
|
|
||||||
animation = false;
|
|
||||||
QWidget::setFixedSize(size);
|
|
||||||
}
|
|
||||||
const QRect windowRect = m_settings->windowRect(position, isHide);
|
|
||||||
|
|
||||||
internalMove(windowRect.topLeft());
|
internalMove(windowRect.topLeft());
|
||||||
|
|
||||||
m_size = m_settings->m_mainWindowSize;
|
m_size = m_settings->m_mainWindowSize;
|
||||||
|
|
||||||
|
QWidget::setFixedSize(size);
|
||||||
|
setStrutPartial();
|
||||||
|
|
||||||
m_mainPanel->update();
|
m_mainPanel->update();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user