-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 11 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.h | 4 |
4 files changed, 11 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index da0706e..6b304ec 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -43,11 +43,11 @@ MediaWidget::~MediaWidget() | |||
43 | { | 43 | { |
44 | } | 44 | } |
45 | 45 | ||
46 | void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, | 46 | void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, |
47 | const Skin &skin, const QSize &buttonAreaSize ) | 47 | const Skin &skin ) |
48 | { | 48 | { |
49 | buttonMask = skin.buttonMask( skinInfo, buttonCount, buttonAreaSize ); | 49 | buttonMask = skin.buttonMask( skinInfo, buttonCount ); |
50 | 50 | ||
51 | buttons.clear(); | 51 | buttons.clear(); |
52 | buttons.reserve( buttonCount ); | 52 | buttons.reserve( buttonCount ); |
53 | 53 | ||
@@ -84,9 +84,9 @@ void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, co | |||
84 | backgroundPixmap = skin.backgroundImage(); | 84 | backgroundPixmap = skin.backgroundImage(); |
85 | buttonUpImage = skin.buttonUpImage(); | 85 | buttonUpImage = skin.buttonUpImage(); |
86 | buttonDownImage = skin.buttonDownImage(); | 86 | buttonDownImage = skin.buttonDownImage(); |
87 | 87 | ||
88 | setupButtons( skinInfo, buttonCount, skin, buttonUpImage.size() ); | 88 | setupButtons( skinInfo, buttonCount, skin ); |
89 | } | 89 | } |
90 | 90 | ||
91 | void MediaWidget::closeEvent( QCloseEvent * ) | 91 | void MediaWidget::closeEvent( QCloseEvent * ) |
92 | { | 92 | { |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 4bd8760..0fe4772 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -101,9 +101,9 @@ signals: | |||
101 | void lessClicked(); | 101 | void lessClicked(); |
102 | 102 | ||
103 | protected: | 103 | protected: |
104 | void setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, | 104 | void setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, |
105 | const Skin &skin, const QSize &buttonAreaSize ); | 105 | const Skin &skin ); |
106 | Button setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ); | 106 | Button setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ); |
107 | 107 | ||
108 | void loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix = QString::null ); | 108 | void loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &fileNameInfix = QString::null ); |
109 | void loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ); | 109 | void loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ); |
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index ef70957..d3918d1 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp | |||
@@ -8,14 +8,14 @@ Skin::Skin( const QString &name, const QString &fileNameInfix ) | |||
8 | { | 8 | { |
9 | m_skinPath = "opieplayer2/skins/" + name; | 9 | m_skinPath = "opieplayer2/skins/" + name; |
10 | } | 10 | } |
11 | 11 | ||
12 | void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount, const QSize &buttonAreaSize ) | 12 | void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) |
13 | { | 13 | { |
14 | backgroundImage(); | 14 | backgroundImage(); |
15 | buttonUpImage(); | 15 | buttonUpImage(); |
16 | buttonDownImage(); | 16 | buttonDownImage(); |
17 | ( void )buttonMask( skinButtonInfo, buttonCount, buttonAreaSize ); | 17 | ( void )buttonMask( skinButtonInfo, buttonCount ); |
18 | } | 18 | } |
19 | 19 | ||
20 | QImage Skin::backgroundImage() const | 20 | QImage Skin::backgroundImage() const |
21 | { | 21 | { |
@@ -37,16 +37,15 @@ QImage Skin::buttonDownImage() const | |||
37 | m_buttonDownImage = QImage( Resource::findPixmap( QString( "%1/skin%2_down" ).arg( m_skinPath ).arg( m_fileNameInfix ) ) ); | 37 | m_buttonDownImage = QImage( Resource::findPixmap( QString( "%1/skin%2_down" ).arg( m_skinPath ).arg( m_fileNameInfix ) ) ); |
38 | return m_buttonDownImage; | 38 | return m_buttonDownImage; |
39 | } | 39 | } |
40 | 40 | ||
41 | QImage Skin::buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount, const QSize &buttonAreaSize ) const | 41 | QImage Skin::buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const |
42 | { | 42 | { |
43 | if ( buttonAreaSize != m_buttonMask.size() ) | ||
44 | m_buttonMask = QImage(); | ||
45 | |||
46 | if ( !m_buttonMask.isNull() ) | 43 | if ( !m_buttonMask.isNull() ) |
47 | return m_buttonMask; | 44 | return m_buttonMask; |
48 | 45 | ||
46 | QSize buttonAreaSize = buttonUpImage().size(); | ||
47 | |||
49 | m_buttonMask = QImage( buttonAreaSize, 8, 255 ); | 48 | m_buttonMask = QImage( buttonAreaSize, 8, 255 ); |
50 | m_buttonMask.fill( 0 ); | 49 | m_buttonMask.fill( 0 ); |
51 | 50 | ||
52 | for ( uint i = 0; i < buttonCount; ++i ) | 51 | for ( uint i = 0; i < buttonCount; ++i ) |
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h index 14873e7..ee19f4b 100644 --- a/noncore/multimedia/opieplayer2/skin.h +++ b/noncore/multimedia/opieplayer2/skin.h | |||
@@ -11,15 +11,15 @@ class Skin | |||
11 | { | 11 | { |
12 | public: | 12 | public: |
13 | Skin( const QString &name, const QString &fileNameInfix ); | 13 | Skin( const QString &name, const QString &fileNameInfix ); |
14 | 14 | ||
15 | void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount, const QSize &buttonAreaSize ); | 15 | void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ); |
16 | 16 | ||
17 | QImage backgroundImage() const; | 17 | QImage backgroundImage() const; |
18 | QImage buttonUpImage() const; | 18 | QImage buttonUpImage() const; |
19 | QImage buttonDownImage() const; | 19 | QImage buttonDownImage() const; |
20 | 20 | ||
21 | QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount, const QSize &buttonAreaSize ) const; | 21 | QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const; |
22 | 22 | ||
23 | QImage buttonMaskImage( const QString &fileName ) const; | 23 | QImage buttonMaskImage( const QString &fileName ) const; |
24 | 24 | ||
25 | private: | 25 | private: |