diff options
Diffstat (limited to 'tdeui/ktabbar.cpp')
| -rw-r--r-- | tdeui/ktabbar.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/tdeui/ktabbar.cpp b/tdeui/ktabbar.cpp index 29479c0e9..ed30bc466 100644 --- a/tdeui/ktabbar.cpp +++ b/tdeui/ktabbar.cpp @@ -43,12 +43,12 @@ KTabBar::KTabBar( TQWidget *parent, const char *name ) setMouseTracking( true ); mEnableCloseButtonTimer = new TQTimer( this ); - connect( mEnableCloseButtonTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( enableCloseButton() ) ); + connect( mEnableCloseButtonTimer, TQ_SIGNAL( timeout() ), TQ_SLOT( enableCloseButton() ) ); mActivateDragSwitchTabTimer = new TQTimer( this ); - connect( mActivateDragSwitchTabTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( activateDragSwitchTab() ) ); + connect( mActivateDragSwitchTabTimer, TQ_SIGNAL( timeout() ), TQ_SLOT( activateDragSwitchTab() ) ); - connect(this, TQT_SIGNAL(layoutChanged()), TQT_SLOT(onLayoutChange())); + connect(this, TQ_SIGNAL(layoutChanged()), TQ_SLOT(onLayoutChange())); } KTabBar::~KTabBar() @@ -87,7 +87,7 @@ void KTabBar::setTabEnabled( int id, bool enabled ) void KTabBar::mouseDoubleClickEvent( TQMouseEvent *e ) { - if( e->button() != Qt::LeftButton ) + if( e->button() != TQt::LeftButton ) return; TQTab *tab = selectTab( e->pos() ); @@ -100,11 +100,11 @@ void KTabBar::mouseDoubleClickEvent( TQMouseEvent *e ) void KTabBar::mousePressEvent( TQMouseEvent *e ) { - if( e->button() == Qt::LeftButton ) { + if( e->button() == TQt::LeftButton ) { mEnableCloseButtonTimer->stop(); mDragStart = e->pos(); } - else if( e->button() == Qt::RightButton ) { + else if( e->button() == TQt::RightButton ) { TQTab *tab = selectTab( e->pos() ); if( tab ) { emit( contextMenu( indexOf( tab->identifier() ), mapToGlobal( e->pos() ) ) ); @@ -116,7 +116,7 @@ void KTabBar::mousePressEvent( TQMouseEvent *e ) void KTabBar::mouseMoveEvent( TQMouseEvent *e ) { - if ( e->state() == Qt::LeftButton ) { + if ( e->state() == TQt::LeftButton ) { TQTab *tab = selectTab( e->pos() ); if ( mDragSwitchTab && tab != mDragSwitchTab ) { mActivateDragSwitchTabTimer->stop(); @@ -134,7 +134,7 @@ void KTabBar::mouseMoveEvent( TQMouseEvent *e ) } } } - else if ( e->state() == Qt::MidButton ) { + else if ( e->state() == TQt::MidButton ) { if (mReorderStartTab==-1) { int delay = TDEGlobalSettings::dndEventDelay(); TQPoint newPos = e->pos(); @@ -144,7 +144,7 @@ void KTabBar::mouseMoveEvent( TQMouseEvent *e ) TQTab *tab = selectTab( e->pos() ); if( tab && mTabReorderingEnabled ) { mReorderStartTab = indexOf( tab->identifier() ); - grabMouse( tqsizeAllCursor ); + grabMouse( TQt::sizeAllCursor ); return; } } @@ -201,7 +201,7 @@ void KTabBar::mouseMoveEvent( TQMouseEvent *e ) mEnableCloseButtonTimer->start( TQApplication::doubleClickInterval(), true ); } mHoverCloseButtonTab = t; - connect( mHoverCloseButton, TQT_SIGNAL( clicked() ), TQT_SLOT( closeButtonClicked() ) ); + connect( mHoverCloseButton, TQ_SIGNAL( clicked() ), TQ_SLOT( closeButtonClicked() ) ); return; } } @@ -230,7 +230,7 @@ void KTabBar::activateDragSwitchTab() void KTabBar::mouseReleaseEvent( TQMouseEvent *e ) { - if( e->button() == Qt::MidButton ) { + if( e->button() == TQt::MidButton ) { if ( mReorderStartTab==-1 ) { TQTab *tab = selectTab( e->pos() ); if( tab ) { @@ -240,7 +240,7 @@ void KTabBar::mouseReleaseEvent( TQMouseEvent *e ) } else { releaseMouse(); - setCursor( tqarrowCursor ); + setCursor( TQt::arrowCursor ); mReorderStartTab=-1; mReorderPreviousTab=-1; } @@ -282,7 +282,7 @@ void KTabBar::dropEvent( TQDropEvent *e ) #ifndef TQT_NO_WHEELEVENT void KTabBar::wheelEvent( TQWheelEvent *e ) { - if ( e->orientation() == Qt::Horizontal ) + if ( e->orientation() == TQt::Horizontal ) return; emit( wheelDelta( e->delta() ) ); @@ -298,9 +298,19 @@ void KTabBar::setTabColor( int id, const TQColor& color ) } } +void KTabBar::resetTabColor( int id ) +{ + TQTab *t = tab(id); + if (t) { + if (mTabColors.contains(id)) + mTabColors.remove(id); + repaint(t->rect(), false); + } +} + const TQColor &KTabBar::tabColor( int id ) const { - if ( mTabColors.contains( id ) ) + if ( mTabColors.contains(id) && mTabColors[id].isValid() ) return mTabColors[id]; return colorGroup().foreground(); @@ -359,7 +369,7 @@ void KTabBar::paintLabel( TQPainter *p, const TQRect& br, flags |= TQStyle::Style_HasFocus; TQColorGroup cg( colorGroup() ); - if ( mTabColors.contains( t->identifier() ) ) + if ( mTabColors.contains(t->identifier()) && mTabColors[t->identifier()].isValid() ) cg.setColor( TQColorGroup::Foreground, mTabColors[t->identifier()] ); style().drawControl( TQStyle::CE_TabBarLabel, p, this, r, |
