summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 376f8d3..d135647 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -126,97 +126,99 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
int height = d->height();
if( (width != pixBg->width() ) || (height != pixBg->height() ) ) {
// odebug << "<<<<<<<< scale image >>>>>>>>>>>>" << oendl;
QImage img;
img = pixBg->convertToImage();
pixBg->convertFromImage( img.smoothScale( width, height));
}
setBackgroundPixmap( *pixBg);
songInfo.setFocusPolicy( QWidget::NoFocus );
// changeTextColor( &songInfo );
// songInfo.setBackgroundColor( QColor( 167, 212, 167 ));
// songInfo.setFrameStyle( QFrame::NoFrame);
// songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken );
//NoFrame
// songInfo.setForegroundColor(Qt::white);
slider.setFixedHeight( 20 );
slider.setMinValue( 0 );
slider.setMaxValue( 1 );
slider.setFocusPolicy( QWidget::NoFocus );
slider.setBackgroundPixmap( *pixBg );
time.setFocusPolicy( QWidget::NoFocus );
time.setAlignment( Qt::AlignCenter );
time.setFrame(FALSE);
changeTextColor( &time );
resizeEvent( NULL );
connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
// connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
setLooping( mediaPlayerState->fullscreen() );
// setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
-this->setFocus();
+ this->setFocus();
+ if(this->x() < 0 || this->y() < 0)
+ this->move(0,0);
}
AudioWidget::~AudioWidget() {
// setPlaying( false);
for ( int i = 0; i < 10; i++ ) {
if(buttonPixUp[i]) delete buttonPixUp[i];
if(buttonPixDown[i]) delete buttonPixDown[i];
}
if(pixBg) delete pixBg;
if(imgUp) delete imgUp;
if(imgDn) delete imgDn;
if(imgButtonMask) delete imgButtonMask;
for ( int i = 0; i < 10; i++ ) {
if(masks[i]) delete masks[i];
}
}
QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
QPixmap pix( img.width(), img.height() );
QPainter p( &pix );
p.drawTiledPixmap( pix.rect(), bg, offset );
p.drawImage( 0, 0, img );
return new QPixmap( pix );
}
QPixmap *maskPixToMask( QPixmap pix, QBitmap mask )
{
QPixmap *pixmap = new QPixmap( pix );
pixmap->setMask( mask );
return pixmap;
}
void AudioWidget::resizeEvent( QResizeEvent * ) {
int h = height();
int w = width();
songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) );
slider.setFixedWidth( w - 110 );
slider.setGeometry( QRect( 15, h - 30, w - 90, 20 ) );
slider.setBackgroundOrigin( QWidget::ParentOrigin );
time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) );