summaryrefslogtreecommitdiff
path: root/libopie
authordrw <drw>2003-04-13 23:00:25 (UTC)
committer drw <drw>2003-04-13 23:00:25 (UTC)
commit377a172d8b497674d14d7e3580a008228f83d081 (patch) (side-by-side diff)
tree7a4fdb5986db9ce9b3b26c9c0b56ece9ec63a468 /libopie
parentf744559411664bc8c017bd642302ffe72dfbbb84 (diff)
downloadopie-377a172d8b497674d14d7e3580a008228f83d081.zip
opie-377a172d8b497674d14d7e3580a008228f83d081.tar.gz
opie-377a172d8b497674d14d7e3580a008228f83d081.tar.bz2
OTabWidget::getCurrentTab() is now OTabWidget::currentTab()
Diffstat (limited to 'libopie') (more/less context) (show whitespace changes)
-rw-r--r--libopie/otabwidget.cpp20
-rw-r--r--libopie/otabwidget.h7
2 files changed, 13 insertions, 14 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp
index a1fd2c0..05aafd4 100644
--- a/libopie/otabwidget.cpp
+++ b/libopie/otabwidget.cpp
@@ -69,25 +69,25 @@ OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPositi
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 ) ) );
setTabStyle( s );
setTabPosition( p );
- currentTab= 0x0;
+ currTab= 0x0;
}
OTabWidget::~OTabWidget()
{
}
void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label )
{
QPixmap iconset = loadSmooth( icon );
QTab *tab = new QTab();
if ( tabBarStyle == IconTab )
@@ -138,26 +138,26 @@ void OTabWidget::removePage( QWidget *childwidget )
int i = 0;
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 )
+ currTab = tabs.current();
+ if ( !currTab )
{
widgetStack->setFrameStyle( QFrame::NoFrame );
}
setUpLayout();
}
}
}
void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label)
{
OTabInfo *currtab = tabs.first();
@@ -241,25 +241,25 @@ OTabWidget::TabStyle OTabWidget::tabStyle() const
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 == currentTab )
+ if ( tabinfo == currTab )
currtab->setText( tabinfo->label() );
else
currtab->setText( QString::null );
}
else
{
currtab->iconset = 0x0;
currtab->setText( tabinfo->label() );
}
}
tabBarStack->raiseWidget( tabBar );
}
@@ -326,44 +326,44 @@ void OTabWidget::slotTabListSelected( int index )
QPixmap OTabWidget::loadSmooth( const QString &name )
{
QImage image = Resource::loadImage( name );
QPixmap pixmap;
pixmap.convertFromImage( image.smoothScale( 14, 14 ) );
return pixmap;
}
void OTabWidget::selectTab( OTabInfo *tab )
{
if ( tabBarStyle == IconTab )
{
- if ( currentTab )
+ if ( currTab )
{
- tabBar->tab( currentTab->id() )->setText( QString::null );
+ tabBar->tab( currTab->id() )->setText( QString::null );
setUpLayout();
}
tabBar->tab( tab->id() )->setText( tab->label() );
tabBar->setCurrentTab( tab->id() );
setUpLayout();
tabBar->update();
}
else
{
tabBar->setCurrentTab( tab->id() );
}
widgetStack->raiseWidget( tab->control() );
emit currentChanged( tab->control() );
- currentTab = tab;
+ currTab = tab;
}
void OTabWidget::setUpLayout()
{
tabBar->layoutTabs();
QSize t( tabBarStack->sizeHint() );
if ( tabBarStyle == IconTab )
{
if ( t.width() > width() )
t.setWidth( width() );
}
else
@@ -389,21 +389,21 @@ void OTabWidget::setUpLayout()
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::getCurrentTab()
+int OTabWidget::currentTab()
{
- if ( currentTab )
+ if ( currTab )
{
- return currentTab->id();
+ return currTab->id();
}
return -1;
}
diff --git a/libopie/otabwidget.h b/libopie/otabwidget.h
index 23fe774..bcd9a85 100644
--- a/libopie/otabwidget.h
+++ b/libopie/otabwidget.h
@@ -186,42 +186,41 @@ public:
*
* @param tab id for widget to select.
*/
void setCurrentTab(int);
/**
* @fn sizeHint()
* @brief Reimplemented for internal purposes.
*/
QSize sizeHint() const;
/**
- * @fn getCurrentTab( )
+ * @fn currentTab( )
* @brief returns current tab id.
*/
- //FIXME TT coding style currentTab() -zecke
- int getCurrentTab();
+ int currentTab();
protected:
/**
* @fn resizeEvent( QResizeEvent * )
* @brief Reimplemented for internal purposes.
*/
void resizeEvent( QResizeEvent * );
private:
OTabInfoList tabs;
- OTabInfo *currentTab;
+ OTabInfo *currTab;
TabStyle tabBarStyle;
TabPosition tabBarPosition;
QWidgetStack *tabBarStack;
OTabBar *tabBar;
QComboBox *tabList;
QWidgetStack *widgetStack;
/**
* @fn loadSmooth( const QString &name )