fixed(dock): fix bug 2697

This commit is contained in:
wangxuwen 2019-09-19 14:43:08 +08:00
parent 3cfbc502f0
commit 212103100b
2 changed files with 4 additions and 22 deletions

View File

@ -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;

View File

@ -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();
}