Improved AutoHideSidebar to provide better resize behavior if parent widget is resized

This commit is contained in:
Uwe Kindler
2022-11-03 11:34:04 +01:00
parent 716207f600
commit 3b97fdc2ce
6 changed files with 204 additions and 82 deletions

View File

@@ -173,6 +173,14 @@ SideBarLocation CAutoHideTab::sideBarLocation() const
void CAutoHideTab::setOrientation(Qt::Orientation Orientation)
{
d->Orientation = Orientation;
if (orientation() == Qt::Horizontal)
{
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
}
else
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
}
CPushButton::setButtonOrientation((Qt::Horizontal == Orientation)
? CPushButton::Horizontal : CPushButton::VerticalTopToBottom);
updateStyle();