fix icon only config for side tab bars

This commit is contained in:
Syarif Fakhri 2022-10-19 17:35:36 +08:00
parent 7ed3f8b2d1
commit 9eb9ee4071

View File

@ -141,34 +141,35 @@ void CDockWidgetSideTab::updateOrientationAndSpacing(SideTabBarArea area)
{
setOrientation((area == Bottom || area == Top) ? Qt::Horizontal : Qt::Vertical);
/*if (CDockManager::testConfigFlag(CDockManager::LeftSideBarPrioritizeIconOnly) && area == Left)
if (icon().isNull())
{
d->TitleLabel->hide();
d->TitleLayout->setContentsMargins(0, 0, 0, 0);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing / 2, Spacing / 2);
return;
}
if (CDockManager::testConfigFlag(CDockManager::LeftSideBarPrioritizeIconOnly) && area == Left)
{
setText("");
setOrientation(Qt::Horizontal);
return;
}
if (CDockManager::testConfigFlag(CDockManager::RightSideBarPrioritizeIconOnly) && area == Right)
{
d->TitleLabel->hide();
d->TitleLayout->setContentsMargins(0, 0, 0, 0);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing, Spacing / 2);
setText("");
setOrientation(Qt::Horizontal);
return;
}
if (CDockManager::testConfigFlag(CDockManager::BottomSideBarPrioritizeIconOnly) && area == Bottom)
{
d->TitleLabel->hide();
d->TitleLayout->setContentsMargins(0, 0, 0, 0);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing / 2, Spacing);
setText("");
setOrientation(Qt::Horizontal);
return;
}
if (CDockManager::testConfigFlag(CDockManager::TopSideBarPrioritizeIconOnly) && area == Top)
{
d->TitleLabel->hide();
d->TitleLayout->setContentsMargins(0, 0, 0, 0);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing / 2, Spacing / 2);
setText("");
setOrientation(Qt::Horizontal);
return;
}*/
}
}