summaryrefslogtreecommitdiff
path: root/libopie/otabwidget.cpp
Unidiff
Diffstat (limited to 'libopie/otabwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/otabwidget.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp
index a1fd2c0..05aafd4 100644
--- a/libopie/otabwidget.cpp
+++ b/libopie/otabwidget.cpp
@@ -75,13 +75,13 @@ OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPositi
75 tabBarStack->addWidget( tabList, 1 ); 75 tabBarStack->addWidget( tabList, 1 );
76 connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) ); 76 connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) );
77 77
78 setTabStyle( s ); 78 setTabStyle( s );
79 setTabPosition( p ); 79 setTabPosition( p );
80 80
81 currentTab= 0x0; 81 currTab= 0x0;
82} 82}
83 83
84OTabWidget::~OTabWidget() 84OTabWidget::~OTabWidget()
85{ 85{
86} 86}
87 87
@@ -144,14 +144,14 @@ void OTabWidget::removePage( QWidget *childwidget )
144 { 144 {
145 tabList->removeItem( i ); 145 tabList->removeItem( i );
146 } 146 }
147 widgetStack->removeWidget( childwidget ); 147 widgetStack->removeWidget( childwidget );
148 tabs.remove( tab ); 148 tabs.remove( tab );
149 delete tab; 149 delete tab;
150 currentTab = tabs.current(); 150 currTab = tabs.current();
151 if ( !currentTab ) 151 if ( !currTab )
152 { 152 {
153 widgetStack->setFrameStyle( QFrame::NoFrame ); 153 widgetStack->setFrameStyle( QFrame::NoFrame );
154 } 154 }
155 155
156 setUpLayout(); 156 setUpLayout();
157 } 157 }
@@ -247,13 +247,13 @@ void OTabWidget::setTabStyle( TabStyle s )
247 for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) 247 for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() )
248 { 248 {
249 currtab = tabBar->tab( tabinfo->id() ); 249 currtab = tabBar->tab( tabinfo->id() );
250 if ( tabBarStyle == IconTab ) 250 if ( tabBarStyle == IconTab )
251 { 251 {
252 currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) ); 252 currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) );
253 if ( tabinfo == currentTab ) 253 if ( tabinfo == currTab )
254 currtab->setText( tabinfo->label() ); 254 currtab->setText( tabinfo->label() );
255 else 255 else
256 currtab->setText( QString::null ); 256 currtab->setText( QString::null );
257 } 257 }
258 else 258 else
259 { 259 {
@@ -332,15 +332,15 @@ QPixmap OTabWidget::loadSmooth( const QString &name )
332} 332}
333 333
334void OTabWidget::selectTab( OTabInfo *tab ) 334void OTabWidget::selectTab( OTabInfo *tab )
335{ 335{
336 if ( tabBarStyle == IconTab ) 336 if ( tabBarStyle == IconTab )
337 { 337 {
338 if ( currentTab ) 338 if ( currTab )
339 { 339 {
340 tabBar->tab( currentTab->id() )->setText( QString::null ); 340 tabBar->tab( currTab->id() )->setText( QString::null );
341 setUpLayout(); 341 setUpLayout();
342 } 342 }
343 tabBar->tab( tab->id() )->setText( tab->label() ); 343 tabBar->tab( tab->id() )->setText( tab->label() );
344 tabBar->setCurrentTab( tab->id() ); 344 tabBar->setCurrentTab( tab->id() );
345 setUpLayout(); 345 setUpLayout();
346 tabBar->update(); 346 tabBar->update();
@@ -351,13 +351,13 @@ void OTabWidget::selectTab( OTabInfo *tab )
351 } 351 }
352 352
353 widgetStack->raiseWidget( tab->control() ); 353 widgetStack->raiseWidget( tab->control() );
354 354
355 emit currentChanged( tab->control() ); 355 emit currentChanged( tab->control() );
356 356
357 currentTab = tab; 357 currTab = tab;
358} 358}
359 359
360void OTabWidget::setUpLayout() 360void OTabWidget::setUpLayout()
361{ 361{
362 tabBar->layoutTabs(); 362 tabBar->layoutTabs();
363 QSize t( tabBarStack->sizeHint() ); 363 QSize t( tabBarStack->sizeHint() );
@@ -395,15 +395,15 @@ QSize OTabWidget::sizeHint() const
395 395
396void OTabWidget::resizeEvent( QResizeEvent * ) 396void OTabWidget::resizeEvent( QResizeEvent * )
397{ 397{
398 setUpLayout(); 398 setUpLayout();
399} 399}
400 400
401int OTabWidget::getCurrentTab() 401int OTabWidget::currentTab()
402{ 402{
403 if ( currentTab ) 403 if ( currTab )
404 { 404 {
405 return currentTab->id(); 405 return currTab->id();
406 } 406 }
407 return -1; 407 return -1;
408} 408}
409 409