summaryrefslogtreecommitdiff
path: root/noncore
authorsimon <simon>2002-12-09 15:15:23 (UTC)
committer simon <simon>2002-12-09 15:15:23 (UTC)
commit3f37a852175ace7ee69b626f48eaea19d736b6ed (patch) (side-by-side diff)
tree5b35af63926143660dc634d27b9b230cc13aca7c /noncore
parent80902b6ade54252e05cf948040a11b2e975f6759 (diff)
downloadopie-3f37a852175ace7ee69b626f48eaea19d736b6ed.zip
opie-3f37a852175ace7ee69b626f48eaea19d736b6ed.tar.gz
opie-3f37a852175ace7ee69b626f48eaea19d736b6ed.tar.bz2
- pixBg is now backgroundPixmap and shared in the base class
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
5 files changed, 15 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 5cc2814..553c56b 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -90,17 +90,17 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
//skin = "scaleTest";
// color of background, frame, degree of transparency
QString skinPath = "opieplayer2/skins/" + skin;
- pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
+ backgroundPixmap = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 );
buttonMask.fill( 0 );
for ( uint i = 0; i < buttonCount; i++ ) {
Button button;
@@ -118,30 +118,30 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
if ( !qRed( imgMask.pixel( x, y ) ) )
line[x] = i + 1;
}
}
buttons.insert( i, button );
}
- setBackgroundPixmap( pixBg );
+ setBackgroundPixmap( backgroundPixmap );
songInfo.setFocusPolicy( QWidget::NoFocus );
// 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 );
slider.setMaxValue( 1 );
slider.setFocusPolicy( QWidget::NoFocus );
- slider.setBackgroundPixmap( pixBg );
+ slider.setBackgroundPixmap( backgroundPixmap );
// Config cofg("qpe");
// cofg.setGroup("Appearance");
// QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) );
time.setFocusPolicy( QWidget::NoFocus );
time.setAlignment( Qt::AlignCenter );
@@ -200,18 +200,18 @@ void AudioWidget::resizeEvent( QResizeEvent * ) {
slider.setGeometry( QRect( 15, h - 22, w - 90, 20 ) );
slider.setBackgroundOrigin( QWidget::ParentOrigin );
time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) );
upperLeftOfButtonMask.rx() = ( w - imgUp.width() ) / 2;
upperLeftOfButtonMask.ry() = (( h - imgUp.height() ) / 2) - 10;
QPoint p = upperLeftOfButtonMask;
- QPixmap pixUp = combineImageWithBackground( imgUp, pixBg, p );
- QPixmap pixDn = combineImageWithBackground( imgDn, pixBg, p );
+ QPixmap pixUp = combineImageWithBackground( imgUp, backgroundPixmap, p );
+ QPixmap pixDn = combineImageWithBackground( imgDn, backgroundPixmap, p );
for ( uint i = 0; i < buttons.count(); i++ ) {
if ( !buttons[i].mask.isNull() ) {
buttons[i].pixUp = maskPixToMask( pixUp, buttons[i].mask );
buttons[i].pixDown = maskPixToMask( pixDn, buttons[i].mask );
}
}
}
@@ -399,17 +399,17 @@ void AudioWidget::showEvent( QShowEvent* ) {
void AudioWidget::paintEvent( QPaintEvent * pe ) {
if ( !pe->erased() ) {
// Combine with background and double buffer
QPixmap pix( pe->rect().size() );
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
- p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
+ p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
for ( unsigned int i = 0; i < buttons.count(); i++ )
paintButton( p, buttons[ i ] );
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
QPainter p( this );
for ( unsigned int i = 0; i < buttons.count(); i++ )
paintButton( p, buttons[ i ] );
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 7a775cd..69837cd 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -89,17 +89,16 @@ protected:
private slots:
void skipFor();
void skipBack();
void stopSkip();
private:
void setToggleButton( int, bool );
int skipDirection;
QString skin;
- QPixmap pixBg;
QImage imgUp;
QImage imgDn;
OTicker songInfo;
QSlider slider;
QLineEdit time;
bool isStreaming : 1;
bool audioSliderBeingMoved : 1;
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 163f449..211e56c 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -93,13 +93,15 @@ protected:
MediaPlayerState &mediaPlayerState;
PlayListWidget &playList;
ButtonMap buttons;
QImage buttonMask;
QPoint upperLeftOfButtonMask;
+
+ QPixmap backgroundPixmap;
};
#endif // MEDIAWIDGET_H
/* vim: et sw=4 ts=4
*/
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index a483434..a8bf252 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -87,17 +87,17 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) );
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
QString skinPath = "opieplayer2/skins/" + skin;
- pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
+ backgroundPixmap = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 );
buttonMask.fill( 0 );
for ( int i = 0; i < 7; i++ ) {
Button &button = buttons[ i ];
@@ -113,17 +113,17 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye
for ( int x = 0; x < imgUp.width(); x++ ) {
if ( !qRed( imgMask.pixel( x, y ) ) )
line[x] = i + 1;
}
}
}
}
- setBackgroundPixmap( pixBg );
+ setBackgroundPixmap( backgroundPixmap );
slider = new QSlider( Qt::Horizontal, this );
slider->setMinValue( 0 );
slider->setMaxValue( 1 );
slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) );
//slider->setFocusPolicy( QWidget::NoFocus );
resizeEvent( NULL );
@@ -158,27 +158,27 @@ void VideoWidget::resizeEvent( QResizeEvent * ) {
int w = width();
//int Vh = 160;
//int Vw = 220;
slider->setFixedWidth( w - 20 );
slider->setGeometry( QRect( 15, h - 22, w - 90, 20 ) );
slider->setBackgroundOrigin( QWidget::ParentOrigin );
slider->setFocusPolicy( QWidget::NoFocus );
- slider->setBackgroundPixmap( pixBg );
+ slider->setBackgroundPixmap( backgroundPixmap );
upperLeftOfButtonMask.rx() = 0;// ( imgUp->width() ) / 2;
if(w>h)
upperLeftOfButtonMask.ry() = 0;
else
upperLeftOfButtonMask.ry() = 185;//(( Vh - imgUp->height() ) / 2) - 10;
QPoint p = upperLeftOfButtonMask;
- QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p );
- QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p );
+ QPixmap *pixUp = combineVImageWithBackground( imgUp, backgroundPixmap, p );
+ QPixmap *pixDn = combineVImageWithBackground( imgDn, backgroundPixmap, p );
for ( int i = 0; i < 7; i++ ) {
Button &button = buttons[ i ];
if ( !button.mask.isNull() ) {
button.pixUp = maskVPixToMask( *pixUp, button.mask );
button.pixDown = maskVPixToMask( *pixDn, button.mask );
}
@@ -340,17 +340,17 @@ void VideoWidget::makeVisible() {
disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
} else {
showNormal();
showMaximized();
- setBackgroundPixmap( pixBg );
+ setBackgroundPixmap( backgroundPixmap );
QWidget *d = QApplication::desktop();
int w = d->width();
int h = d->height();
if(w>h) {
int newW=(w/2)-(246/2); //this will only work with 320x240
videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
} else {
@@ -385,17 +385,17 @@ void VideoWidget::paintEvent( QPaintEvent * pe) {
// Clear the background
p.setBrush( QBrush( Qt::black ) );
} else {
if ( !pe->erased() ) {
// Combine with background and double buffer
QPixmap pix( pe->rect().size() );
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
- p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() );
+ p.drawTiledPixmap( pe->rect(), backgroundPixmap, pe->rect().topLeft() );
for ( unsigned int i = 0; i < buttons.count(); i++ ) {
paintButton( p, buttons[ i ] );
}
QPainter p2( this );
p2.drawPixmap( pe->rect().topLeft(), pix );
} else {
QPainter p( this );
for ( unsigned int i = 0; i < buttons.count(); i++ )
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index a271120..9d5239b 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -92,17 +92,16 @@ protected:
void showEvent( QShowEvent *se );
void mouseMoveEvent( QMouseEvent *event );
void mousePressEvent( QMouseEvent *event );
void mouseReleaseEvent( QMouseEvent *event );
void keyReleaseEvent( QKeyEvent *e);
private:
// Ticker songInfo;
- QPixmap pixBg;
QImage imgUp;
QImage imgDn;
QString skin;
void setToggleButton( int, bool );
QString backgroundPix;