Commit bb21ce68 authored by Sascha Peilicke's avatar Sascha Peilicke

Removed Konsole TabBar spacer item (review request 2883).

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1095490
parent 933ff9ee
...@@ -462,14 +462,12 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position , QObject* ...@@ -462,14 +462,12 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position , QObject*
_tabBarLayout->addWidget(_newTabButton); _tabBarLayout->addWidget(_newTabButton);
_tabBarLayout->addWidget(_tabBar); _tabBarLayout->addWidget(_tabBar);
_tabBarLayout->addWidget(_closeTabButton); _tabBarLayout->addWidget(_closeTabButton);
_tabBarSpacer = new QSpacerItem(0,TabBarSpace);
_layout->addWidget(_stackWidget); _layout->addWidget(_stackWidget);
searchBar()->setParent(_containerWidget); searchBar()->setParent(_containerWidget);
if ( position == NavigationPositionTop ) if ( position == NavigationPositionTop )
{ {
_layout->insertLayout(0,_tabBarLayout); _layout->insertLayout(0,_tabBarLayout);
_layout->insertItemAt(0,_tabBarSpacer);
_layout->insertWidget(-1,searchBar()); _layout->insertWidget(-1,searchBar());
_tabBar->setShape(QTabBar::RoundedNorth); _tabBar->setShape(QTabBar::RoundedNorth);
} }
...@@ -477,7 +475,6 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position , QObject* ...@@ -477,7 +475,6 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position , QObject*
{ {
_layout->insertWidget(-1,searchBar()); _layout->insertWidget(-1,searchBar());
_layout->insertLayout(-1,_tabBarLayout); _layout->insertLayout(-1,_tabBarLayout);
_layout->insertItemAt(-1,_tabBarSpacer);
_tabBar->setShape(QTabBar::RoundedSouth); _tabBar->setShape(QTabBar::RoundedSouth);
} }
else else
...@@ -520,14 +517,6 @@ void TabbedViewContainer::setTabBarVisible(bool visible) ...@@ -520,14 +517,6 @@ void TabbedViewContainer::setTabBarVisible(bool visible)
_tabBar->setVisible(visible); _tabBar->setVisible(visible);
_newTabButton->setVisible(visible && (features() & QuickNewView)); _newTabButton->setVisible(visible && (features() & QuickNewView));
_closeTabButton->setVisible(visible && (features() & QuickCloseView)); _closeTabButton->setVisible(visible && (features() & QuickCloseView));
if ( visible )
{
_tabBarSpacer->changeSize(0,TabBarSpace);
}
else
{
_tabBarSpacer->changeSize(0,0);
}
} }
QList<ViewContainer::NavigationPosition> TabbedViewContainer::supportedNavigationPositions() const QList<ViewContainer::NavigationPosition> TabbedViewContainer::supportedNavigationPositions() const
{ {
...@@ -535,9 +524,9 @@ QList<ViewContainer::NavigationPosition> TabbedViewContainer::supportedNavigatio ...@@ -535,9 +524,9 @@ QList<ViewContainer::NavigationPosition> TabbedViewContainer::supportedNavigatio
} }
void TabbedViewContainer::navigationPositionChanged(NavigationPosition position) void TabbedViewContainer::navigationPositionChanged(NavigationPosition position)
{ {
// this method assumes that there are only three items // this method assumes that there are only two items
// in the layout // in the layout
Q_ASSERT( _layout->count() == 4 ); Q_ASSERT( _layout->count() == 3 );
// index of stack widget in the layout when tab bar is at the bottom // index of stack widget in the layout when tab bar is at the bottom
const int StackIndexWithTabBottom = 0; const int StackIndexWithTabBottom = 0;
...@@ -546,11 +535,9 @@ void TabbedViewContainer::navigationPositionChanged(NavigationPosition position) ...@@ -546,11 +535,9 @@ void TabbedViewContainer::navigationPositionChanged(NavigationPosition position)
&& _layout->indexOf(_stackWidget) == StackIndexWithTabBottom ) && _layout->indexOf(_stackWidget) == StackIndexWithTabBottom )
{ {
_layout->removeItem(_tabBarLayout); _layout->removeItem(_tabBarLayout);
_layout->removeItem(_tabBarSpacer);
_layout->removeWidget(searchBar()); _layout->removeWidget(searchBar());
_layout->insertLayout(0,_tabBarLayout); _layout->insertLayout(0,_tabBarLayout);
_layout->insertItemAt(0,_tabBarSpacer);
_layout->insertWidget(-1,searchBar()); _layout->insertWidget(-1,searchBar());
_tabBar->setShape(QTabBar::RoundedNorth); _tabBar->setShape(QTabBar::RoundedNorth);
} }
...@@ -558,12 +545,10 @@ void TabbedViewContainer::navigationPositionChanged(NavigationPosition position) ...@@ -558,12 +545,10 @@ void TabbedViewContainer::navigationPositionChanged(NavigationPosition position)
&& _layout->indexOf(_stackWidget) != StackIndexWithTabBottom ) && _layout->indexOf(_stackWidget) != StackIndexWithTabBottom )
{ {
_layout->removeItem(_tabBarLayout); _layout->removeItem(_tabBarLayout);
_layout->removeItem(_tabBarSpacer);
_layout->removeWidget(searchBar()); _layout->removeWidget(searchBar());
_layout->insertWidget(-1,searchBar()); _layout->insertWidget(-1,searchBar());
_layout->insertLayout(-1,_tabBarLayout); _layout->insertLayout(-1,_tabBarLayout);
_layout->insertItemAt(-1,_tabBarSpacer);
_tabBar->setShape(QTabBar::RoundedSouth); _tabBar->setShape(QTabBar::RoundedSouth);
} }
} }
......
...@@ -450,13 +450,11 @@ private: ...@@ -450,13 +450,11 @@ private:
ViewContainerTabBar* _tabBar; ViewContainerTabBar* _tabBar;
QPointer<QStackedWidget> _stackWidget; QPointer<QStackedWidget> _stackWidget;
QPointer<QWidget> _containerWidget; QPointer<QWidget> _containerWidget;
QSpacerItem* _tabBarSpacer;
TabbedViewContainerLayout* _layout; TabbedViewContainerLayout* _layout;
QHBoxLayout* _tabBarLayout; QHBoxLayout* _tabBarLayout;
QToolButton* _newTabButton; QToolButton* _newTabButton;
QToolButton* _closeTabButton; QToolButton* _closeTabButton;
static const int TabBarSpace = 2;
}; };
/** A plain view container with no navigation display */ /** A plain view container with no navigation display */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment