-rw-r--r-- | libopie/otabwidget.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp index 6ef4034..aaf14ce 100644 --- a/libopie/otabwidget.cpp +++ b/libopie/otabwidget.cpp @@ -58,25 +58,25 @@ OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPositi else { tabBarPosition = Top; } } else { tabBarStyle = s; tabBarPosition = p; } widgetStack = new QWidgetStack( this, "widgetstack" ); - widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); + widgetStack->setFrameStyle( QFrame::NoFrame ); widgetStack->setLineWidth( style().defaultFrameWidth() ); tabBarStack = new QWidgetStack( this, "tabbarstack" ); tabBar = new OTabBar( tabBarStack, "tabbar" ); tabBarStack->addWidget( tabBar, 0 ); connect( tabBar, SIGNAL( selected( int ) ), this, SLOT( slotTabBarSelected( int ) ) ); tabList = new QComboBox( false, tabBarStack, "tablist" ); tabBarStack->addWidget( tabList, 1 ); connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) ); @@ -123,24 +123,25 @@ void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &lab if ( tabBarStyle == IconTab || tabBarStyle == IconList ) { tabList->insertItem( iconset, label, -1 ); } else { tabList->insertItem( label ); } widgetStack->addWidget( child, tabid ); widgetStack->raiseWidget( child ); + widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label ); tabs.append( tabinfo ); selectTab( tabinfo ); } void OTabWidget::removePage( QWidget *childwidget ) { if ( childwidget ) { OTabInfo *tab = tabs.first(); while ( tab && tab->control() != childwidget ) @@ -155,24 +156,29 @@ void OTabWidget::removePage( QWidget *childwidget ) while ( i < tabList->count() && tabList->text( i ) != tab->label() ) { i++; } if ( tabList->text( i ) == tab->label() ) { tabList->removeItem( i ); } widgetStack->removeWidget( childwidget ); tabs.remove( tab ); delete tab; currentTab = tabs.current(); + if ( !currentTab ) + { + widgetStack->setFrameStyle( QFrame::NoFrame ); + } + setUpLayout(); } } } void OTabWidget::setCurrentTab( QWidget *childwidget ) { OTabInfo *newtab = tabs.first(); while ( newtab && newtab->control() != childwidget ) { newtab = tabs.next(); } |