Fixed wrong position of AutoHideDockContainer when uncollapsing

This commit is contained in:
Uwe Kindler 2022-10-27 10:52:05 +02:00
parent 11223bf664
commit f20c3bc63a

View File

@ -216,30 +216,30 @@ void CAutoHideDockContainer::updateSize()
switch (sideTabBarArea()) switch (sideTabBarArea())
{ {
case SideBarLocation::Top: case SideBarLocation::Top:
move(rect.topLeft());
resize(rect.width(), qMin(rect.height(), d->Size.height())); resize(rect.width(), qMin(rect.height(), d->Size.height()));
move(rect.topLeft());
break; break;
case SideBarLocation::Left: case SideBarLocation::Left:
move(rect.topLeft());
resize(qMin(d->Size.width(), rect.width()), rect.height()); resize(qMin(d->Size.width(), rect.width()), rect.height());
move(rect.topLeft());
break; break;
case SideBarLocation::Right: case SideBarLocation::Right:
{ {
resize(qMin(d->Size.width(), rect.width()), rect.height());
QPoint p = rect.topRight(); QPoint p = rect.topRight();
p.rx() -= (width() - 1); p.rx() -= (width() - 1);
move(p); move(p);
resize(qMin(d->Size.width(), rect.width()), rect.height());
} }
break; break;
case SideBarLocation::Bottom: case SideBarLocation::Bottom:
{ {
resize(rect.width(), qMin(rect.height(), d->Size.height()));
QPoint p = rect.bottomLeft(); QPoint p = rect.bottomLeft();
p.ry() -= (height() - 1); p.ry() -= (height() - 1);
move(p); move(p);
resize(rect.width(), qMin(rect.height(), d->Size.height()));
} }
break; break;
} }
@ -404,18 +404,14 @@ void CAutoHideDockContainer::collapseView(bool Enable)
if (Enable) if (Enable)
{ {
hide(); hide();
d->DockArea->hide();
d->DockWidget->hide();
qApp->removeEventFilter(this); qApp->removeEventFilter(this);
} }
else else
{ {
updateSize();
d->updateResizeHandleSizeLimitMax(); d->updateResizeHandleSizeLimitMax();
raise(); raise();
show(); show();
d->DockArea->show();
d->DockWidget->show();
updateSize();
d->DockManager->setDockWidgetFocused(d->DockWidget); d->DockManager->setDockWidgetFocused(d->DockWidget);
qApp->installEventFilter(this); qApp->installEventFilter(this);
} }