summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-08 23:09:11 (UTC)
committer alwin <alwin>2004-11-08 23:09:11 (UTC)
commit4638c11f127d420818e2356359ae6f2223fb4407 (patch) (side-by-side diff)
tree423eabc9469964ced331b04aa51730f13de0b062
parent1480f96170cb7cd7c262a14ad56ff08f384de10f (diff)
downloadopie-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 (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/otabwidget.cpp2
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
@@ -257,170 +257,170 @@ void OTabWidget::setTabStyle( TabStyle s )
{
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;
}