-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 6b304ec..0d1c8b6 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -50,58 +50,56 @@ void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount buttons.clear(); buttons.reserve( buttonCount ); for ( uint i = 0; i < buttonCount; ++i ) { Button button = setupButton( skinInfo[ i ], skin ); buttons.push_back( button ); } } MediaWidget::Button MediaWidget::setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ) { Button button; button.command = buttonInfo.command; button.type = buttonInfo.type; button.mask = skin.buttonMaskImage( buttonInfo.fileName ); return button; } void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix ) { Config cfg( "OpiePlayer" ); cfg.setGroup( "Options" ); - QString skin = cfg.readEntry( "Skin","default" ); + QString name = cfg.readEntry( "Skin","default" ); - loadSkin( skinInfo, buttonCount, skin, fileNameInfix ); + Skin skin( name, fileNameInfix ); + loadSkin( skinInfo, buttonCount, skin ); } -void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) +void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const Skin &skin ) { - Skin skin( name, fileNameInfix ); - - QString skinPath = "opieplayer2/skins/" + name; backgroundPixmap = skin.backgroundImage(); buttonUpImage = skin.buttonUpImage(); buttonDownImage = skin.buttonDownImage(); setupButtons( skinInfo, buttonCount, skin ); } void MediaWidget::closeEvent( QCloseEvent * ) { mediaPlayerState.setList(); } void MediaWidget::paintEvent( QPaintEvent *pe ) { QPainter p( this ); if ( mediaPlayerState.isFullscreen() ) { // Clear the background p.setBrush( QBrush( Qt::black ) ); return; } if ( !pe->erased() ) { // Combine with background and double buffer diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 0fe4772..9f13677 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -85,49 +85,49 @@ public: public slots: virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; virtual void setLength( long length ) = 0; virtual void setPlaying( bool playing ) = 0; virtual void loadSkin() = 0; signals: void moreReleased(); void lessReleased(); void forwardReleased(); void backReleased(); void forwardClicked(); void backClicked(); void moreClicked(); void lessClicked(); protected: void setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, const Skin &skin ); Button setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ); void loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix = QString::null ); - void loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ); + void loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const Skin &skin ); virtual void closeEvent( QCloseEvent * ); virtual void paintEvent( QPaintEvent *pe ); Button *buttonAt( const QPoint &position ); virtual void mousePressEvent( QMouseEvent *event ); virtual void mouseReleaseEvent( QMouseEvent *event ); virtual void makeVisible(); void handleCommand( Command command, bool buttonDown ); bool isOverButton( const QPoint &position, int buttonId ) const; void paintAllButtons( QPainter &p ); void paintButton( const Button &button ); void paintButton( QPainter &p, const Button &button ); void setToggleButton( Button &button, bool down ); void setToggleButton( Command command, bool down ); void toggleButton( Button &button ); |