From 212103100b855fc5169eeb421e7a15e5f7602b11 Mon Sep 17 00:00:00 2001 From: wangxuwen Date: Thu, 19 Sep 2019 14:43:08 +0800 Subject: [PATCH] fixed(dock): fix bug 2697 --- frame/util/docksettings.cpp | 8 -------- frame/window/mainwindow.cpp | 18 ++++-------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/frame/util/docksettings.cpp b/frame/util/docksettings.cpp index 488f78e76..e3b0a8fd9 100644 --- a/frame/util/docksettings.cpp +++ b/frame/util/docksettings.cpp @@ -171,14 +171,6 @@ const QSize DockSettings::panelSize() const const QRect DockSettings::windowRect(const Position position, const bool hide) const { 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 int offsetX = (primaryRect.width() - size.width()) / 2; diff --git a/frame/window/mainwindow.cpp b/frame/window/mainwindow.cpp index fdf818182..0b1fe4833 100644 --- a/frame/window/mainwindow.cpp +++ b/frame/window/mainwindow.cpp @@ -501,25 +501,15 @@ void MainWindow::updateGeometry() m_mainPanel->setPositonValue(position); resizeMainPanelWindow(); - bool animation = 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); + const QRect windowRect = m_settings->windowRect(position, true); internalMove(windowRect.topLeft()); m_size = m_settings->m_mainWindowSize; + QWidget::setFixedSize(size); + setStrutPartial(); + m_mainPanel->update(); }