summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-11 12:53:29 (UTC)
committer simon <simon>2002-12-11 12:53:29 (UTC)
commit9b8e5d7c225ac2dd399e392d57e3d19348412e1a (patch) (unidiff)
tree463674357359136235c75703edafe109e6515d16
parentdd6a6d5345e191ffa6da3e015c4e024bd8ca67b7 (diff)
downloadopie-9b8e5d7c225ac2dd399e392d57e3d19348412e1a.zip
opie-9b8e5d7c225ac2dd399e392d57e3d19348412e1a.tar.gz
opie-9b8e5d7c225ac2dd399e392d57e3d19348412e1a.tar.bz2
- slight simplification in the API
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp11
-rw-r--r--noncore/multimedia/opieplayer2/skin.h4
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
46void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, 46void 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
91void MediaWidget::closeEvent( QCloseEvent * ) 91void 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
103protected: 103protected:
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
12void Skin::preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount, const QSize &buttonAreaSize ) 12void 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
20QImage Skin::backgroundImage() const 20QImage Skin::backgroundImage() const
@@ -38,14 +38,13 @@ QImage Skin::buttonDownImage() const
38 return m_buttonDownImage; 38 return m_buttonDownImage;
39} 39}
40 40
41QImage Skin::buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount, const QSize &buttonAreaSize ) const 41QImage 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
12public: 12public:
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