summaryrefslogtreecommitdiff
authordrw <drw>2005-03-03 21:05:50 (UTC)
committer drw <drw>2005-03-03 21:05:50 (UTC)
commitb92ff0d96359e7f383c5fc1c54271c3819bef413 (patch) (side-by-side diff)
treeef1dc4c57f1af409464bc430c04a25e9d45aca6e
parent67ddc501f2a52c7f35ca4044fb0094e759a45d76 (diff)
downloadopie-b92ff0d96359e7f383c5fc1c54271c3819bef413.zip
opie-b92ff0d96359e7f383c5fc1c54271c3819bef413.tar.gz
opie-b92ff0d96359e7f383c5fc1c54271c3819bef413.tar.bz2
Some minor fixes to drawing of tab bar
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/otabwidget.cpp16
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
@@ -375,67 +375,81 @@ QPixmap OTabWidget::loadSmooth( const QString &name )
void OTabWidget::selectTab( OTabInfo *tab )
{
if ( m_tabBarStyle == IconTab )
{
// Remove text label from currently selected tab
if ( m_currTab )
{
m_tabBar->tab( m_currTab->id() )->setText( QString::null );
//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() );
emit currentChanged( tab->control() );
m_currTab = tab;
}
void OTabWidget::setUpLayout()
{
if ( m_usingTabs )
{
m_tabBar->update();
m_tabBar->layoutTabs();
}
}
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() );
m_widgetStack->setGeometry( 0, 0, width(), height()-t.height()+QMAX(0, lw-2) );
}
else
{
if ( m_usingTabs )
m_tabBar->setGeometry( QMAX(0, lw-2), 0, t.width(), t.height() );
else