-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.h | 5 |
3 files changed, 17 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 617e0fe..2031b4d 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -96,26 +96,26 @@ void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCo | |||
96 | cfg.setGroup( "Options" ); | 96 | cfg.setGroup( "Options" ); |
97 | QString skin = cfg.readEntry( "Skin","default" ); | 97 | QString skin = cfg.readEntry( "Skin","default" ); |
98 | 98 | ||
99 | loadSkin( skinInfo, buttonCount, skin, fileNameInfix ); | 99 | loadSkin( skinInfo, buttonCount, skin, fileNameInfix ); |
100 | } | 100 | } |
101 | 101 | ||
102 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) | 102 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) |
103 | { | 103 | { |
104 | Skin skin( name, fileNameInfix ); | 104 | Skin skin( name, fileNameInfix ); |
105 | 105 | ||
106 | QString skinPath = "opieplayer2/skins/" + name; | 106 | QString skinPath = "opieplayer2/skins/" + name; |
107 | backgroundPixmap = skin.backgroundImage(); | 107 | backgroundPixmap = skin.backgroundImage(); |
108 | buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); | 108 | buttonUpImage = skin.buttonUpImage(); |
109 | buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); | 109 | buttonDownImage = skin.buttonDownImage(); |
110 | 110 | ||
111 | setupButtons( skinInfo, buttonCount, | 111 | setupButtons( skinInfo, buttonCount, |
112 | skinPath + QString::fromLatin1( "/skin%1_mask_" ).arg( fileNameInfix ), buttonUpImage.size() ); | 112 | skinPath + QString::fromLatin1( "/skin%1_mask_" ).arg( fileNameInfix ), buttonUpImage.size() ); |
113 | } | 113 | } |
114 | 114 | ||
115 | void MediaWidget::closeEvent( QCloseEvent * ) | 115 | void MediaWidget::closeEvent( QCloseEvent * ) |
116 | { | 116 | { |
117 | mediaPlayerState.setList(); | 117 | mediaPlayerState.setList(); |
118 | } | 118 | } |
119 | 119 | ||
120 | void MediaWidget::paintEvent( QPaintEvent *pe ) | 120 | void MediaWidget::paintEvent( QPaintEvent *pe ) |
121 | { | 121 | { |
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index 097b29a..352368f 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp | |||
@@ -5,14 +5,24 @@ | |||
5 | 5 | ||
6 | Skin::Skin( const QString &name, const QString &fileNameInfix ) | 6 | Skin::Skin( const QString &name, const QString &fileNameInfix ) |
7 | : m_name( name ), m_fileNameInfix( fileNameInfix ) | 7 | : m_name( name ), m_fileNameInfix( fileNameInfix ) |
8 | { | 8 | { |
9 | m_skinPath = "opieplayer2/skins/" + name; | 9 | m_skinPath = "opieplayer2/skins/" + name; |
10 | } | 10 | } |
11 | 11 | ||
12 | QImage Skin::backgroundImage() const | 12 | QImage Skin::backgroundImage() const |
13 | { | 13 | { |
14 | return QImage( Resource::findPixmap( QString( "%1/background" ).arg( m_skinPath ) ) ); | 14 | return QImage( Resource::findPixmap( QString( "%1/background" ).arg( m_skinPath ) ) ); |
15 | } | 15 | } |
16 | 16 | ||
17 | QImage Skin::buttonUpImage() const | ||
18 | { | ||
19 | return QImage( Resource::findPixmap( QString( "%1/skin%2_up" ).arg( m_skinPath ).arg( m_fileNameInfix ) ) ); | ||
20 | } | ||
21 | |||
22 | QImage Skin::buttonDownImage() const | ||
23 | { | ||
24 | return QImage( Resource::findPixmap( QString( "%1/skin%2_down" ).arg( m_skinPath ).arg( m_fileNameInfix ) ) ); | ||
25 | } | ||
26 | |||
17 | /* vim: et sw=4 ts=4 | 27 | /* vim: et sw=4 ts=4 |
18 | */ | 28 | */ |
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h index 3c09e43..85f9e57 100644 --- a/noncore/multimedia/opieplayer2/skin.h +++ b/noncore/multimedia/opieplayer2/skin.h | |||
@@ -1,22 +1,27 @@ | |||
1 | #ifndef SKIN_H | 1 | #ifndef SKIN_H |
2 | #define SKIN_H | 2 | #define SKIN_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qimage.h> | 5 | #include <qimage.h> |
6 | 6 | ||
7 | class Skin | 7 | class Skin |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | Skin( const QString &name, const QString &fileNameInfix ); | 10 | Skin( const QString &name, const QString &fileNameInfix ); |
11 | 11 | ||
12 | QImage backgroundImage() const; | 12 | QImage backgroundImage() const; |
13 | QImage buttonUpImage() const; | ||
14 | QImage buttonDownImage() const; | ||
13 | 15 | ||
14 | private: | 16 | private: |
15 | QString m_name; | 17 | QString m_name; |
16 | QString m_fileNameInfix; | 18 | QString m_fileNameInfix; |
17 | QString m_skinPath; | 19 | QString m_skinPath; |
20 | |||
21 | Skin( const Skin & ); | ||
22 | Skin &operator=( const Skin & ); | ||
18 | }; | 23 | }; |
19 | 24 | ||
20 | #endif // SKIN_H | 25 | #endif // SKIN_H |
21 | /* vim: et sw=4 ts=4 | 26 | /* vim: et sw=4 ts=4 |
22 | */ | 27 | */ |