author | simon <simon> | 2002-12-09 15:04:10 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 15:04:10 (UTC) |
commit | dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa (patch) (unidiff) | |
tree | 5ff73aaf1ac1c59cde2e9ddafe8cebcddb162158 | |
parent | d3451a94e3a4425f9f1b1dcc3999259270780631 (diff) | |
download | opie-dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa.zip opie-dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa.tar.gz opie-dcc1922ecb8c6816e4ae9ba7973f8653e482b2aa.tar.bz2 |
- getting rid of the buttonPixUp/Down arrays, reuse the Button structure
instead
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 32 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
2 files changed, 12 insertions, 22 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 089ef6a..3baa087 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -120,7 +120,2 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
120 | 120 | ||
121 | for ( int i = 0; i < 7; i++ ) { | ||
122 | buttonPixUp[i] = NULL; | ||
123 | buttonPixDown[i] = NULL; | ||
124 | } | ||
125 | |||
126 | setBackgroundPixmap( pixBg ); | 121 | setBackgroundPixmap( pixBg ); |
@@ -142,7 +137,4 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
142 | 137 | ||
143 | VideoWidget::~VideoWidget() { | 138 | VideoWidget::~VideoWidget() |
144 | for ( int i = 0; i < 7; i++ ) { | 139 | { |
145 | delete buttonPixUp[i]; | ||
146 | delete buttonPixDown[i]; | ||
147 | } | ||
148 | } | 140 | } |
@@ -157,5 +149,5 @@ QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | |||
157 | 149 | ||
158 | QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { | 150 | QPixmap maskVPixToMask( QPixmap pix, QBitmap mask ) { |
159 | QPixmap *pixmap = new QPixmap( pix ); | 151 | QPixmap pixmap( pix ); |
160 | pixmap->setMask( mask ); | 152 | pixmap.setMask( mask ); |
161 | return pixmap; | 153 | return pixmap; |
@@ -189,6 +181,4 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { | |||
189 | if ( !button.mask.isNull() ) { | 181 | if ( !button.mask.isNull() ) { |
190 | delete buttonPixUp[i]; | 182 | button.pixUp = maskVPixToMask( *pixUp, button.mask ); |
191 | delete buttonPixDown[i]; | 183 | button.pixDown = maskVPixToMask( *pixDn, button.mask ); |
192 | buttonPixUp[i] = maskVPixToMask( *pixUp, button.mask ); | ||
193 | buttonPixDown[i] = maskVPixToMask( *pixDn, button.mask ); | ||
194 | } | 184 | } |
@@ -262,6 +252,8 @@ void VideoWidget::paintButton( QPainter &p, int i ) { | |||
262 | 252 | ||
263 | if ( buttons[i].isDown ) { | 253 | Button &button = buttons[ i ]; |
264 | p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); | 254 | |
255 | if ( button.isDown ) { | ||
256 | p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); | ||
265 | } else { | 257 | } else { |
266 | p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); | 258 | p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); |
267 | } | 259 | } |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index fd301f9..aeb6429 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -102,4 +102,2 @@ private: | |||
102 | QImage imgDn; | 102 | QImage imgDn; |
103 | QPixmap *buttonPixUp[7]; | ||
104 | QPixmap *buttonPixDown[7]; | ||
105 | QString skin; | 103 | QString skin; |