diff options
Diffstat (limited to 'amarok/src/multitabbar.cpp')
-rw-r--r-- | amarok/src/multitabbar.cpp | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/amarok/src/multitabbar.cpp b/amarok/src/multitabbar.cpp index b11b3a67..5e2bc629 100644 --- a/amarok/src/multitabbar.cpp +++ b/amarok/src/multitabbar.cpp @@ -33,7 +33,7 @@ #include <tqbutton.h> #include <tqfontmetrics.h> -#include <tqlayout.h> +#include <layout.h> #include <tqpainter.h> #include <tqpopupmenu.h> #include <tqstyle.h> @@ -124,7 +124,7 @@ void MultiTabBarInternal::setStyle( enum MultiTabBar::MultiTabBarStyle style ) mainLayout->setAutoAdd( true ); } - viewport() ->tqrepaint(); + viewport() ->repaint(); } void MultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clipy, int clipw, int cliph ) @@ -133,32 +133,32 @@ void MultiTabBarInternal::drawContents ( TQPainter * paint, int clipx, int clipy if ( m_position == MultiTabBar::Right ) { - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 0, 0, viewport() ->height() ); - paint->setPen( tqcolorGroup().background().dark( 120 ) ); + paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 1, 0, 1, viewport() ->height() ); } else if ( m_position == MultiTabBar::Left ) { - paint->setPen( tqcolorGroup().light() ); + paint->setPen( colorGroup().light() ); paint->drawLine( 23, 0, 23, viewport() ->height() ); paint->drawLine( 22, 0, 22, viewport() ->height() ); - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 0, 0, viewport() ->height() ); } else if ( m_position == MultiTabBar::Bottom ) { - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 0, viewport() ->width(), 0 ); - paint->setPen( tqcolorGroup().background().dark( 120 ) ); + paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 0, 1, viewport() ->width(), 1 ); } else { - paint->setPen( tqcolorGroup().light() ); + paint->setPen( colorGroup().light() ); paint->drawLine( 0, 23, viewport() ->width(), 23 ); paint->drawLine( 0, 22, viewport() ->width(), 22 ); - /* paint->setPen(tqcolorGroup().shadow()); + /* paint->setPen(colorGroup().shadow()); paint->drawLine(0,0,0,viewport()->height());*/ } } @@ -219,8 +219,8 @@ void MultiTabBarInternal::mousePressEvent( TQMouseEvent *ev ) void MultiTabBarInternal::resizeEvent( TQResizeEvent *ev ) { /* kdDebug()<<"MultiTabBarInternal::resizeEvent"<<endl; - kdDebug()<<"MultiTabBarInternal::resizeEvent - box tqgeometry"<<box->tqgeometry()<<endl; - kdDebug()<<"MultiTabBarInternal::resizeEvent - tqgeometry"<<tqgeometry()<<endl;*/ + kdDebug()<<"MultiTabBarInternal::resizeEvent - box geometry"<<box->geometry()<<endl; + kdDebug()<<"MultiTabBarInternal::resizeEvent - geometry"<<geometry()<<endl;*/ if ( ev ) TQScrollView::resizeEvent( ev ); @@ -481,7 +481,7 @@ void MultiTabBarInternal::setPosition( enum MultiTabBar::MultiTabBarPosition pos m_position = pos; for ( uint i = 0;i < m_tabs.count();i++ ) m_tabs.at( i ) ->setTabsPosition( m_position ); - viewport() ->tqrepaint(); + viewport() ->repaint(); } @@ -584,13 +584,13 @@ void MultiTabBarButton::slotClicked() void MultiTabBarButton::setPosition( MultiTabBar::MultiTabBarPosition pos ) { m_position = pos; - tqrepaint(); + repaint(); } void MultiTabBarButton::setStyle( MultiTabBar::MultiTabBarStyle style ) { m_style = style; - tqrepaint(); + repaint(); } void MultiTabBarButton::hideEvent( TQHideEvent* he ) @@ -660,18 +660,18 @@ void MultiTabBarButton::slotAnimTimer() { if ( m_animEnter ) { m_animCount += 1; - tqrepaint( false ); + repaint( false ); if ( m_animCount >= ANIM_MAX ) m_animTimer->stop(); } else { m_animCount -= 1; - tqrepaint( false ); + repaint( false ); if ( m_animCount <= 0 ) m_animTimer->stop(); } } -TQSize MultiTabBarButton::tqsizeHint() const +TQSize MultiTabBarButton::sizeHint() const { constPolish(); @@ -687,7 +687,7 @@ TQSize MultiTabBarButton::tqsizeHint() const } #endif if ( isMenuButton() ) - w += tqstyle().tqpixelMetric( TQStyle::PM_MenuButtonIndicator, this ); + w += tqstyle().pixelMetric( TQStyle::PM_MenuButtonIndicator, this ); if ( pixmap() ) { TQPixmap * pm = const_cast< TQPixmap * >( pixmap() ); @@ -697,7 +697,7 @@ TQSize MultiTabBarButton::tqsizeHint() const TQString s( text() ); bool empty = s.isEmpty(); if ( empty ) - s = TQString::tqfromLatin1( "XXXX" ); + s = TQString::fromLatin1( "XXXX" ); TQFontMetrics fm = fontMetrics(); TQSize sz = fm.size( ShowPrefix, s ); if ( !empty || !w ) @@ -754,7 +754,7 @@ void MultiTabBarTab::setTabsPosition( MultiTabBar::MultiTabBarPosition pos ) } setPosition( pos ); - // tqrepaint(); + // repaint(); } void MultiTabBarTab::setIcon( const TQString& icon ) @@ -785,7 +785,7 @@ void MultiTabBarTab::slotClicked() if ( m_animTimer->isActive() ) { m_animCount = ANIM_MAX; m_animTimer->stop(); - tqrepaint(); + repaint(); } updateState(); @@ -812,12 +812,12 @@ void MultiTabBarTab::updateState() if ( ( m_position == MultiTabBar::Right || m_position == MultiTabBar::Left ) ) { setFixedWidth( 24 ); if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { - setFixedHeight( MultiTabBarButton::tqsizeHint().width() ); + setFixedHeight( MultiTabBarButton::sizeHint().width() ); } else setFixedHeight( 36 ); } else { setFixedHeight( 24 ); if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { - setFixedWidth( MultiTabBarButton::tqsizeHint().width() ); + setFixedWidth( MultiTabBarButton::sizeHint().width() ); } else setFixedWidth( 36 ); } } else { @@ -870,7 +870,7 @@ void MultiTabBarTab::drawButtonStyled( TQPainter *paint ) const int height = 24; if ( ( m_style == MultiTabBar::KDEV3 ) || ( m_style == MultiTabBar::KDEV3ICON ) || ( m_style == MultiTabBar::AMAROK ) || ( isOn() ) ) { if ( ( m_position == MultiTabBar::Left ) || ( m_position == MultiTabBar::Right ) ) - sh = TQSize( this->height(), this->width() ); //MultiTabBarButton::tqsizeHint(); + sh = TQSize( this->height(), this->width() ); //MultiTabBarButton::sizeHint(); else sh = TQSize( this->width(), this->height() ); } else @@ -887,8 +887,8 @@ void MultiTabBarTab::drawButtonStyled( TQPainter *paint ) if ( isOn() ) st |= TQStyle::Style_On; - tqstyle().tqdrawControl( TQStyle::CE_PushButton, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), tqcolorGroup(), st ); - tqstyle().tqdrawControl( TQStyle::CE_PushButtonLabel, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), tqcolorGroup(), st ); + tqstyle().drawControl( TQStyle::CE_PushButton, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); + tqstyle().drawControl( TQStyle::CE_PushButtonLabel, &painter, this, TQRect( 0, 0, pixmap.width(), pixmap.height() ), colorGroup(), st ); switch ( m_position ) { case MultiTabBar::Left: @@ -904,8 +904,8 @@ void MultiTabBarTab::drawButtonStyled( TQPainter *paint ) paint->drawPixmap( 0, 0, pixmap ); break; } - // style().tqdrawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), - // tqcolorGroup(),TQStyle::Style_Enabled); + // style().drawControl(TQStyle::CE_PushButtonLabel,painter,this, TQRect(0,0,pixmap.width(),pixmap.height()), + // colorGroup(),TQStyle::Style_Enabled); } void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) @@ -913,52 +913,52 @@ void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) TQPixmap pixmap; if ( iconSet() ) pixmap = iconSet() ->pixmap( TQIconSet::Small, TQIconSet::Normal ); - paint->fillRect( 0, 0, 24, 24, tqcolorGroup().background() ); + paint->fillRect( 0, 0, 24, 24, colorGroup().background() ); if ( !isOn() ) { if ( m_position == MultiTabBar::Right ) { - paint->fillRect( 0, 0, 21, 21, TQBrush( tqcolorGroup().background() ) ); + paint->fillRect( 0, 0, 21, 21, TQBrush( colorGroup().background() ) ); - paint->setPen( tqcolorGroup().background().dark( 150 ) ); + paint->setPen( colorGroup().background().dark( 150 ) ); paint->drawLine( 0, 22, 23, 22 ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 0, 0, 23 ); - paint->setPen( tqcolorGroup().background().dark( 120 ) ); + paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 1, 0, 1, 23 ); } else if ( ( m_position == MultiTabBar::Bottom ) || ( m_position == MultiTabBar::Top ) ) { - paint->fillRect( 0, 1, 23, 22, TQBrush( tqcolorGroup().background() ) ); + paint->fillRect( 0, 1, 23, 22, TQBrush( colorGroup().background() ) ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); - paint->setPen( tqcolorGroup().background().dark( 120 ) ); + paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 23, 0, 23, 23 ); - paint->setPen( tqcolorGroup().light() ); + paint->setPen( colorGroup().light() ); paint->drawLine( 0, 22, 23, 22 ); paint->drawLine( 0, 23, 23, 23 ); - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 0, 23, 0 ); - paint->setPen( tqcolorGroup().background().dark( 120 ) ); + paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 0, 1, 23, 1 ); } else { - paint->setPen( tqcolorGroup().background().dark( 120 ) ); + paint->setPen( colorGroup().background().dark( 120 ) ); paint->drawLine( 0, 23, 23, 23 ); - paint->fillRect( 0, 0, 23, 21, TQBrush( tqcolorGroup().background() ) ); + paint->fillRect( 0, 0, 23, 21, TQBrush( colorGroup().background() ) ); paint->drawPixmap( 12 - pixmap.width() / 2, 12 - pixmap.height() / 2, pixmap ); - paint->setPen( tqcolorGroup().light() ); + paint->setPen( colorGroup().light() ); paint->drawLine( 23, 0, 23, 23 ); paint->drawLine( 22, 0, 22, 23 ); - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 0, 0, 23 ); } @@ -966,12 +966,12 @@ void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) } else { if ( m_position == MultiTabBar::Right ) { - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, height() - 1, 23, height() - 1 ); paint->drawLine( 0, height() - 2, 23, height() - 2 ); paint->drawLine( 23, 0, 23, height() - 1 ); paint->drawLine( 22, 0, 22, height() - 1 ); - paint->fillRect( 0, 0, 21, height() - 3, TQBrush( tqcolorGroup().light() ) ); + paint->fillRect( 0, 0, 21, height() - 3, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { @@ -980,9 +980,9 @@ void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) TQPixmap tpixmap( height() - 25 - 3, width() - 2 ); TQPainter painter( &tpixmap ); - painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( tqcolorGroup().light() ) ); + painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( colorGroup().light() ) ); - painter.setPen( tqcolorGroup().text() ); + painter.setPen( colorGroup().text() ); painter.drawText( 0, + width() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); paint->rotate( 90 ); @@ -992,31 +992,31 @@ void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) } else if ( m_position == MultiTabBar::Top ) { - paint->fillRect( 0, 0, width() - 1, 23, TQBrush( tqcolorGroup().light() ) ); + paint->fillRect( 0, 0, width() - 1, 23, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { - paint->setPen( tqcolorGroup().text() ); + paint->setPen( colorGroup().text() ); paint->drawText( 25, height() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); } } else if ( m_position == MultiTabBar::Bottom ) { - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, 23, width() - 1, 23 ); paint->drawLine( 0, 22, width() - 1, 22 ); - paint->fillRect( 0, 0, width() - 1, 21, TQBrush( tqcolorGroup().light() ) ); + paint->fillRect( 0, 0, width() - 1, 21, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { - paint->setPen( tqcolorGroup().text() ); + paint->setPen( colorGroup().text() ); paint->drawText( 25, height() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); } } else { - paint->setPen( tqcolorGroup().shadow() ); + paint->setPen( colorGroup().shadow() ); paint->drawLine( 0, height() - 1, 23, height() - 1 ); paint->drawLine( 0, height() - 2, 23, height() - 2 ); - paint->fillRect( 0, 0, 23, height() - 3, TQBrush( tqcolorGroup().light() ) ); + paint->fillRect( 0, 0, 23, height() - 3, TQBrush( colorGroup().light() ) ); paint->drawPixmap( 10 - pixmap.width() / 2, 10 - pixmap.height() / 2, pixmap ); if ( m_showActiveTabText ) { @@ -1025,9 +1025,9 @@ void MultiTabBarTab::drawButtonClassic( TQPainter *paint ) TQPixmap tpixmap( height() - 25 - 3, width() - 2 ); TQPainter painter( &tpixmap ); - painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( tqcolorGroup().light() ) ); + painter.fillRect( 0, 0, tpixmap.width(), tpixmap.height(), TQBrush( colorGroup().light() ) ); - painter.setPen( tqcolorGroup().text() ); + painter.setPen( colorGroup().text() ); painter.drawText( tpixmap.width() - TQFontMetrics( TQFont() ).width( m_text ), + width() / 2 + TQFontMetrics( TQFont() ).height() / 2, m_text ); paint->rotate( -90 ); @@ -1046,14 +1046,14 @@ void MultiTabBarTab::drawButtonAmarok( TQPainter *paint ) { TQColor fillColor, textColor; if ( isOn() ) { - fillColor = blendColors( tqcolorGroup().highlight(), tqcolorGroup().background(), static_cast<int>( m_animCount * 3.5 ) ); - textColor = blendColors( tqcolorGroup().highlightedText(), tqcolorGroup().text(), static_cast<int>( m_animCount * 4.5 ) ); + fillColor = blendColors( colorGroup().highlight(), colorGroup().background(), static_cast<int>( m_animCount * 3.5 ) ); + textColor = blendColors( colorGroup().highlightedText(), colorGroup().text(), static_cast<int>( m_animCount * 4.5 ) ); } else if ( isEnabled() ) { - fillColor = blendColors( tqcolorGroup().background(), tqcolorGroup().highlight(), static_cast<int>( m_animCount * 3.5 ) ); - textColor = blendColors( tqcolorGroup().text(), tqcolorGroup().highlightedText(), static_cast<int>( m_animCount * 4.5 ) ); + fillColor = blendColors( colorGroup().background(), colorGroup().highlight(), static_cast<int>( m_animCount * 3.5 ) ); + textColor = blendColors( colorGroup().text(), colorGroup().highlightedText(), static_cast<int>( m_animCount * 4.5 ) ); } else { - fillColor = tqcolorGroup().background(); - textColor = tqcolorGroup().text(); + fillColor = colorGroup().background(); + textColor = colorGroup().text(); } #ifndef TQT_NO_ICONSET @@ -1071,7 +1071,7 @@ void MultiTabBarTab::drawButtonAmarok( TQPainter *paint ) TQPainter painter( &pixmap ); // Draw the frame - painter.setPen( tqcolorGroup().mid() ); + painter.setPen( colorGroup().mid() ); /*if ( m_id != bar->visibleTabCount() - 1 )*/ painter.drawLine( 0, 0, 0, pixmap.height() - 1 ); painter.drawLine( 0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1 ); @@ -1099,7 +1099,7 @@ void MultiTabBarTab::drawButtonAmarok( TQPainter *paint ) TQPainter painter( &pixmap ); // Draw the frame - painter.setPen( tqcolorGroup().mid() ); + painter.setPen( colorGroup().mid() ); /*if ( m_id != bar->visibleTabCount() - 1 )*/ painter.drawLine( 0, 0, 0, pixmap.height() - 1 ); painter.drawLine( 0, pixmap.height() - 1, pixmap.width() - 1, pixmap.height() - 1 ); @@ -1147,11 +1147,11 @@ MultiTabBar::MultiTabBar( MultiTabBarMode bm, TQWidget *parent, const char *name m_buttons.setAutoDelete( false ); if ( bm == Vertical ) { m_l = new TQVBoxLayout( this ); - tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding, true ); + setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding, true ); // setFixedWidth(24); } else { m_l = new TQHBoxLayout( this ); - tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed, true ); + setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed, true ); // setFixedHeight(24); } m_l->setMargin( 0 ); @@ -1295,7 +1295,7 @@ void MultiTabBar::fontChange( const TQFont& /* oldFont */ ) { for ( uint i = 0;i < tabs() ->count();i++ ) tabs() ->at( i ) ->resize(); - tqrepaint(); + repaint(); } TQPtrList<MultiTabBarTab>* MultiTabBar::tabs() { return m_internal->tabs();} |