@@ -260,10 +260,10 @@ void DockAreaTitleBarPrivate::createAutoHideTitleLabel()
260260{
261261 AutoHideTitleLabel = new CElidingLabel (" " );
262262 AutoHideTitleLabel->setObjectName (" autoHideTitleLabel" );
263- // At position 0 is the tab bar - insert behind tab bar
264- Layout->insertWidget ( 1 , AutoHideTitleLabel);
265- AutoHideTitleLabel->setVisible (false ); // Default hidden
266- Layout->insertWidget ( 2 , new CSpacerWidget (_this));
263+ // When the tabs are at the top, they will be at position 0, insert the label behind them, and hide it.
264+ Layout->addWidget ( AutoHideTitleLabel);
265+ AutoHideTitleLabel->setVisible (CDockManager::testConfigFlag (CDockManager::TabsAtBottom));
266+ Layout->addWidget ( new CSpacerWidget (_this));
267267}
268268
269269
@@ -272,7 +272,9 @@ void DockAreaTitleBarPrivate::createTabBar()
272272{
273273 TabBar = componentsFactory ()->createDockAreaTabBar (DockArea);
274274 TabBar->setSizePolicy (QSizePolicy::Maximum, QSizePolicy::Preferred);
275- Layout->addWidget (TabBar);
275+ if (!CDockManager::testConfigFlag (CDockManager::TabsAtBottom))
276+ Layout->addWidget (TabBar);
277+
276278 _this->connect (TabBar, SIGNAL (tabClosed (int )), SLOT (markTabsMenuOutdated ()));
277279 _this->connect (TabBar, SIGNAL (tabOpened (int )), SLOT (markTabsMenuOutdated ()));
278280 _this->connect (TabBar, SIGNAL (tabInserted (int )), SLOT (markTabsMenuOutdated ()));
@@ -351,8 +353,8 @@ CDockAreaTitleBar::CDockAreaTitleBar(CDockAreaWidget* parent) :
351353 setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Fixed);
352354
353355 d->createTabBar ();
354- d->createButtons ();
355356 d->createAutoHideTitleLabel ();
357+ d->createButtons ();
356358
357359 setFocusPolicy (Qt::NoFocus);
358360}
@@ -900,9 +902,12 @@ QString CDockAreaTitleBar::titleBarButtonToolTip(TitleBarButton Button) const
900902// ============================================================================
901903void CDockAreaTitleBar::showAutoHideControls (bool Show)
902904{
903- d->TabBar ->setVisible (!Show); // Auto hide toolbar never has tabs
905+ if (Show)
906+ d->TabBar ->setVisible (false ); // Auto hide toolbar never has tabs
907+
904908 d->MinimizeButton ->setVisible (Show);
905- d->AutoHideTitleLabel ->setVisible (Show);
909+ if (!CDockManager::testConfigFlag (CDockManager::TabsAtBottom))
910+ d->AutoHideTitleLabel ->setVisible (Show);
906911}
907912
908913
0 commit comments