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); setOrientation((area == Bottom || area == Top) ? Qt::Horizontal : Qt::Vertical);
/*if (CDockManager::testConfigFlag(CDockManager::LeftSideBarPrioritizeIconOnly) && area == Left) if (icon().isNull())
{ {
d->TitleLabel->hide(); return;
d->TitleLayout->setContentsMargins(0, 0, 0, 0); }
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing / 2, Spacing / 2);
if (CDockManager::testConfigFlag(CDockManager::LeftSideBarPrioritizeIconOnly) && area == Left)
{
setText("");
setOrientation(Qt::Horizontal);
return; return;
} }
if (CDockManager::testConfigFlag(CDockManager::RightSideBarPrioritizeIconOnly) && area == Right) if (CDockManager::testConfigFlag(CDockManager::RightSideBarPrioritizeIconOnly) && area == Right)
{ {
d->TitleLabel->hide(); setText("");
d->TitleLayout->setContentsMargins(0, 0, 0, 0); setOrientation(Qt::Horizontal);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing, Spacing / 2);
return; return;
} }
if (CDockManager::testConfigFlag(CDockManager::BottomSideBarPrioritizeIconOnly) && area == Bottom) if (CDockManager::testConfigFlag(CDockManager::BottomSideBarPrioritizeIconOnly) && area == Bottom)
{ {
d->TitleLabel->hide(); setText("");
d->TitleLayout->setContentsMargins(0, 0, 0, 0); setOrientation(Qt::Horizontal);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing / 2, Spacing);
return; return;
} }
if (CDockManager::testConfigFlag(CDockManager::TopSideBarPrioritizeIconOnly) && area == Top) if (CDockManager::testConfigFlag(CDockManager::TopSideBarPrioritizeIconOnly) && area == Top)
{ {
d->TitleLabel->hide(); setText("");
d->TitleLayout->setContentsMargins(0, 0, 0, 0); setOrientation(Qt::Horizontal);
d->IconLabel->setContentsMargins(Spacing / 2, Spacing / 2, Spacing / 2, Spacing / 2);
return; return;
}*/ }
} }