From b92ff0d96359e7f383c5fc1c54271c3819bef413 Mon Sep 17 00:00:00 2001 From: drw Date: Thu, 03 Mar 2005 21:05:50 +0000 Subject: Some minor fixes to drawing of tab bar --- (limited to 'libopie2/opieui') 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 @@ -388,6 +388,17 @@ void OTabWidget::selectTab( OTabInfo *tab ) 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 ) { @@ -418,11 +429,14 @@ void OTabWidget::resizeEvent( QResizeEvent * ) { m_tabBar->layoutTabs(); t = m_tabBar->sizeHint(); + if ( t.width() > width() ) + t.setWidth( width() ); } else + { t = m_tabList->sizeHint(); - - t.setWidth( width() ); + t.setWidth( width() ); + } int lw = m_widgetStack->lineWidth(); if ( m_tabBarPosition == Bottom ) -- cgit v0.9.0.2