author | alwin <alwin> | 2004-11-08 23:09:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-08 23:09:11 (UTC) |
commit | 4638c11f127d420818e2356359ae6f2223fb4407 (patch) (side-by-side diff) | |
tree | 423eabc9469964ced331b04aa51730f13de0b062 /libopie2/opieui/otabwidget.cpp | |
parent | 1480f96170cb7cd7c262a14ad56ff08f384de10f (diff) | |
download | opie-4638c11f127d420818e2356359ae6f2223fb4407.zip opie-4638c11f127d420818e2356359ae6f2223fb4407.tar.gz opie-4638c11f127d420818e2356359ae6f2223fb4407.tar.bz2 |
ui. in BigScreenmode it had an deep recursion in layout setup. I had
just commented out that line (353) - it seems to work now, but I'm not sure
if it is correct.
I think, this widget should be checked carefully.
Diffstat (limited to 'libopie2/opieui/otabwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index d23b1c9..80a4c9b 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp @@ -161,266 +161,266 @@ void OTabWidget::removePage( QWidget *childwidget ) widgetStack->setFrameStyle( QFrame::NoFrame ); } setUpLayout(); } } } void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label) { OTabInfo *currtab = tabs.first(); while ( currtab && currtab->control() != widget ) { currtab = tabs.next(); } if ( currtab && currtab->control() == widget ) { QTab *tab = tabBar->tab( currtab->id() ); QPixmap icon( loadSmooth( iconset ) ); tab->setText( label ); if ( tabBarStyle == IconTab ) tab->setIconSet( icon ); int i = 0; while ( i < tabList->count() && tabList->text( i ) != currtab->label() ) { i++; } if ( i < tabList->count() && tabList->text( i ) == currtab->label() ) { if ( tabBarStyle == IconTab || tabBarStyle == IconList ) { tabList->changeItem( icon, label, i ); } else { tabList->changeItem( label, i ); } } currtab->setLabel( label ); currtab->setIcon( iconset ); } setUpLayout(); } void OTabWidget::setCurrentTab( QWidget *childwidget ) { OTabInfo *currtab = tabs.first(); while ( currtab && currtab->control() != childwidget ) { currtab = tabs.next(); } if ( currtab && currtab->control() == childwidget ) { selectTab( currtab ); } } void OTabWidget::setCurrentTab( const QString &tabname ) { OTabInfo *newtab = tabs.first(); while ( newtab && newtab->label() != tabname ) { newtab = tabs.next(); } if ( newtab && newtab->label() == tabname ) { selectTab( newtab ); } } void OTabWidget::setCurrentTab(int tabindex) { OTabInfo *newtab = tabs.first(); while ( newtab && newtab->id() != tabindex ) { newtab = tabs.next(); } if ( newtab && newtab->id() == tabindex ) { selectTab( newtab ); } } OTabWidget::TabStyle OTabWidget::tabStyle() const { return tabBarStyle; } void OTabWidget::setTabStyle( TabStyle s ) { tabBarStyle = s; if ( tabBarStyle == TextTab || tabBarStyle == IconTab ) { QTab *currtab; for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) { currtab = tabBar->tab( tabinfo->id() ); if ( tabBarStyle == IconTab ) { currtab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) ); if ( tabinfo == currTab ) currtab->setText( tabinfo->label() ); else currtab->setText( QString::null ); } else { currtab->iconset = 0x0; currtab->setText( tabinfo->label() ); } } tabBarStack->raiseWidget( tabBar ); } else if ( tabBarStyle == TextList || tabBarStyle == IconList ) { tabList->clear(); for ( OTabInfo *tabinfo = tabs.first(); tabinfo; tabinfo = tabs.next() ) { if ( tabBarStyle == IconList ) { tabList->insertItem( loadSmooth( tabinfo->icon() ), tabinfo->label() ); } else { tabList->insertItem( tabinfo->label() ); } } tabBarStack->raiseWidget( tabList ); } setUpLayout(); } OTabWidget::TabPosition OTabWidget::tabPosition() const { return tabBarPosition; } void OTabWidget::setTabPosition( TabPosition p ) { tabBarPosition = p; if ( tabBarPosition == Top ) { tabBar->setShape( QTabBar::RoundedAbove ); } else { tabBar->setShape( QTabBar::RoundedBelow ); } setUpLayout(); } void OTabWidget::slotTabBarSelected( int id ) { OTabInfo *newtab = tabs.first(); while ( newtab && newtab->id() != id ) { newtab = tabs.next(); } if ( newtab && newtab->id() == id ) { selectTab( newtab ); } } void OTabWidget::slotTabListSelected( int index ) { OTabInfo *newtab = tabs.at( index ); if ( newtab ) { selectTab( newtab ); } } QPixmap OTabWidget::loadSmooth( const QString &name ) { QPixmap p; p.convertFromImage( Resource::loadImage( name ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); return p; } void OTabWidget::selectTab( OTabInfo *tab ) { if ( tabBarStyle == IconTab ) { if ( currTab ) { tabBar->tab( currTab->id() )->setText( QString::null ); setUpLayout(); } tabBar->tab( tab->id() )->setText( tab->label() ); tabBar->setCurrentTab( tab->id() ); - setUpLayout(); +// setUpLayout(); tabBar->update(); } else { tabBar->setCurrentTab( tab->id() ); } widgetStack->raiseWidget( tab->control() ); emit currentChanged( tab->control() ); currTab = tab; } void OTabWidget::setUpLayout() { tabBar->layoutTabs(); QSize t( tabBarStack->sizeHint() ); if ( tabBarStyle == IconTab ) { if ( t.width() > width() ) t.setWidth( width() ); } else { t.setWidth( width() ); } int lw = widgetStack->lineWidth(); if ( tabBarPosition == Bottom ) { tabBarStack->setGeometry( QMAX(0, lw-2), height() - t.height() - lw, t.width(), t.height() ); widgetStack->setGeometry( 0, 0, width(), height()-t.height()+QMAX(0, lw-2) ); } else { tabBarStack->setGeometry( QMAX(0, lw-2), 0, t.width(), t.height() ); widgetStack->setGeometry( 0, t.height()-lw, width(), height()-t.height()+QMAX( 0, lw-2 ) ); } if ( autoMask() ) updateMask(); } QSize OTabWidget::sizeHint() const { QSize s( widgetStack->sizeHint() ); QSize t( tabBarStack->sizeHint() ); return QSize( QMAX( s.width(), t.width() ), s.height() + t.height() ); } void OTabWidget::resizeEvent( QResizeEvent * ) { setUpLayout(); } int OTabWidget::currentTab() { if ( currTab ) { return currTab->id(); } return -1; } QWidget* OTabWidget::currentWidget()const { if ( currTab ) { return currTab->control(); } return 0; } |