From 49e5bbbd35bef879faca0d680f1c4d64a61b7b32 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sun, 10 Nov 2002 17:43:03 +0000 Subject: use users default colors for ticker --- (limited to 'noncore/multimedia/opieplayer2') diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index de91a59..e21b0b1 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -55,46 +56,6 @@ extern PlayListWidget *playList; static const int xo = -2; // movable x offset static const int yo = 22; // movable y offset - -Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { - setFrameStyle( WinPanel | Sunken ); - //setText( "No Song" ); -} - -Ticker::~Ticker() { -} - -void Ticker::setText( const QString& text ) { - pos = 0; // reset it everytime the text is changed - scrollText = text; - pixelLen = fontMetrics().width( scrollText ); - killTimers(); - if ( pixelLen > width() ) { - startTimer( 50 ); - } - update(); -} - - -void Ticker::timerEvent( QTimerEvent * ) { - pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; - scroll( -1, 0, contentsRect() ); - repaint( FALSE ); -} - -void Ticker::drawContents( QPainter *p ) { - for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) { - p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); - } - QPixmap pm( width(), height() ); - pm.fill( colorGroup().base() ); - QPainter pmp( &pm ); - for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) { - pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); - } - p->drawPixmap( 0, 0, pm ); -} - struct MediaButton { bool isToggle, isHeld, isDown; }; @@ -174,7 +135,11 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : setBackgroundPixmap( *pixBg ); songInfo.setFocusPolicy( QWidget::NoFocus ); - changeTextColor( &songInfo ); +// changeTextColor( &songInfo ); +// songInfo.setBackgroundColor( QColor( 167, 212, 167 )); +// songInfo.setFrameStyle( QFrame::NoFrame); + songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); +// songInfo.setForegroundColor(Qt::white); slider.setFixedHeight( 20 ); slider.setMinValue( 0 ); -- cgit v0.9.0.2