-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 | |||
@@ -44,9 +44,9 @@ MediaWidget::~MediaWidget() | |||
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 ); |
@@ -85,7 +85,7 @@ void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, co | |||
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 * ) |
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 | |||
@@ -102,7 +102,7 @@ signals: | |||
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 ); |
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 | |||
@@ -9,12 +9,12 @@ Skin::Skin( const QString &name, const QString &fileNameInfix ) | |||
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 |
@@ -38,14 +38,13 @@ QImage Skin::buttonDownImage() const | |||
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 | ||
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 | |||
@@ -12,13 +12,13 @@ class Skin | |||
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 | ||