author | simon <simon> | 2002-12-11 12:53:29 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 12:53:29 (UTC) |
commit | 9b8e5d7c225ac2dd399e392d57e3d19348412e1a (patch) (unidiff) | |
tree | 463674357359136235c75703edafe109e6515d16 /noncore/multimedia/opieplayer2/skin.cpp | |
parent | dd6a6d5345e191ffa6da3e015c4e024bd8ca67b7 (diff) | |
download | opie-9b8e5d7c225ac2dd399e392d57e3d19348412e1a.zip opie-9b8e5d7c225ac2dd399e392d57e3d19348412e1a.tar.gz opie-9b8e5d7c225ac2dd399e392d57e3d19348412e1a.tar.bz2 |
- slight simplification in the API
Diffstat (limited to 'noncore/multimedia/opieplayer2/skin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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 | |||
@@ -6,18 +6,18 @@ | |||
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 | 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 | { |
22 | if ( m_backgroundImage.isNull() ) | 22 | if ( m_backgroundImage.isNull() ) |
23 | m_backgroundImage = QImage( Resource::findPixmap( QString( "%1/background" ).arg( m_skinPath ) ) ); | 23 | m_backgroundImage = QImage( Resource::findPixmap( QString( "%1/background" ).arg( m_skinPath ) ) ); |
@@ -35,20 +35,19 @@ QImage Skin::buttonDownImage() const | |||
35 | { | 35 | { |
36 | if ( m_buttonDownImage.isNull() ) | 36 | if ( m_buttonDownImage.isNull() ) |
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 ) |
53 | addButtonToMask( skinButtonInfo[ i ].command + 1, buttonMaskImage( skinButtonInfo[ i ].fileName ) ); | 52 | addButtonToMask( skinButtonInfo[ i ].command + 1, buttonMaskImage( skinButtonInfo[ i ].fileName ) ); |
54 | 53 | ||