-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index ae396b9..8d7806c 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp @@ -383,16 +383,27 @@ void OTabWidget::selectTab( OTabInfo *tab ) //setUpLayout(); } // Set text label for newly selected tab m_tabBar->tab( tab->id() )->setText( tab->label() ); m_tabBar->setCurrentTab( tab->id() ); setUpLayout(); + + QSize t; + + t = m_tabBar->sizeHint(); + if ( t.width() > width() ) + t.setWidth( width() ); + int lw = m_widgetStack->lineWidth(); + if ( m_tabBarPosition == Bottom ) + m_tabBar->setGeometry( QMAX(0, lw-2), height() - t.height() - lw, t.width(), t.height() ); + else + m_tabBar->setGeometry( QMAX(0, lw-2), 0, t.width(), t.height() ); } else if ( m_tabBarStyle == TextTab ) { m_tabBar->setCurrentTab( tab->id() ); } m_widgetStack->raiseWidget( tab->control() ); @@ -413,21 +424,24 @@ void OTabWidget::setUpLayout() void OTabWidget::resizeEvent( QResizeEvent * ) { QSize t; if ( m_usingTabs ) { m_tabBar->layoutTabs(); t = m_tabBar->sizeHint(); + if ( t.width() > width() ) + t.setWidth( width() ); } else + { t = m_tabList->sizeHint(); - t.setWidth( width() ); + } int lw = m_widgetStack->lineWidth(); if ( m_tabBarPosition == Bottom ) { if ( m_usingTabs ) m_tabBar->setGeometry( QMAX(0, lw-2), height() - t.height() - lw, t.width(), t.height() ); else m_tabList->setGeometry( QMAX(0, lw-2), height() - t.height() - lw, t.width(), t.height() ); |