should behave a bit better when the pages are empty

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=849643
This commit is contained in:
Marco Martin 2008-08-19 21:09:06 +00:00
parent abdb0debb5
commit df487ae43c

View File

@ -96,6 +96,7 @@ void TabBarPrivate::shapeChanged(const QTabBar::Shape shape)
case QTabBar::TriangularEast: case QTabBar::TriangularEast:
mainLayout->setOrientation(Qt::Horizontal); mainLayout->setOrientation(Qt::Horizontal);
mainLayout->itemAt(0)->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); mainLayout->itemAt(0)->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
mainLayout->itemAt(1)->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
break; break;
case QTabBar::RoundedSouth: case QTabBar::RoundedSouth:
@ -106,6 +107,7 @@ void TabBarPrivate::shapeChanged(const QTabBar::Shape shape)
default: default:
mainLayout->setOrientation(Qt::Vertical); mainLayout->setOrientation(Qt::Vertical);
mainLayout->itemAt(0)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); mainLayout->itemAt(0)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
mainLayout->itemAt(1)->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
} }
} }
@ -152,7 +154,7 @@ int TabBar::insertTab(int index, const QIcon &icon, const QString &label, QGraph
page->setLayout(layout); page->setLayout(layout);
layout->addItem(content); layout->addItem(content);
} else { } else {
page->setMaximumHeight(0); page->setPreferredSize(0, 0);
} }
d->pages.insert(qBound(0, index, d->pages.count()), page); d->pages.insert(qBound(0, index, d->pages.count()), page);