summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-09-19 00:43:06 (UTC)
committer llornkcor <llornkcor>2002-09-19 00:43:06 (UTC)
commitac90402cf450e0da9c2600e5ccff185c47075f84 (patch) (unidiff)
tree57c1212e8ffb1d2df8ee782b08d655c4a6998b46
parentdd4b256d39e7a438a7d688471d257dd10a75d138 (diff)
downloadopie-ac90402cf450e0da9c2600e5ccff185c47075f84.zip
opie-ac90402cf450e0da9c2600e5ccff185c47075f84.tar.gz
opie-ac90402cf450e0da9c2600e5ccff185c47075f84.tar.bz2
tweaked gui placement better for landscape
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 7c49733..45f301e 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -20,49 +20,49 @@
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37 37
38#include <qwidget.h> 38#include <qwidget.h>
39#include <qpixmap.h> 39#include <qpixmap.h>
40#include <qbutton.h> 40#include <qbutton.h>
41#include <qpainter.h> 41#include <qpainter.h>
42#include <qframe.h> 42#include <qframe.h>
43#include <qlayout.h> 43#include <qlayout.h>
44 44#include <qdir.h>
45#include <stdlib.h> 45#include <stdlib.h>
46#include <stdio.h> 46#include <stdio.h>
47 47
48#include "audiowidget.h" 48#include "audiowidget.h"
49#include "mediaplayerstate.h" 49#include "mediaplayerstate.h"
50#include "playlistwidget.h" 50#include "playlistwidget.h"
51 51
52extern MediaPlayerState *mediaPlayerState; 52extern MediaPlayerState *mediaPlayerState;
53extern PlayListWidget *playList; 53extern PlayListWidget *playList;
54 54
55static const int xo = -2; // movable x offset 55static const int xo = -2; // movable x offset
56static const int yo = 22; // movable y offset 56static const int yo = 22; // movable y offset
57 57
58 58
59Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { 59Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) {
60 setFrameStyle( WinPanel | Sunken ); 60 setFrameStyle( WinPanel | Sunken );
61 setText( "No Song" ); 61 setText( "No Song" );
62} 62}
63 63
64Ticker::~Ticker() { 64Ticker::~Ticker() {
65} 65}
66 66
67void Ticker::setText( const QString& text ) { 67void Ticker::setText( const QString& text ) {
68 pos = 0; // reset it everytime the text is changed 68 pos = 0; // reset it everytime the text is changed
@@ -232,51 +232,51 @@ AudioWidget::~AudioWidget() {
232 232
233namespace { 233namespace {
234 234
235QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { 235QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
236 QPixmap pix( img.width(), img.height() ); 236 QPixmap pix( img.width(), img.height() );
237 QPainter p( &pix ); 237 QPainter p( &pix );
238 p.drawTiledPixmap( pix.rect(), bg, offset ); 238 p.drawTiledPixmap( pix.rect(), bg, offset );
239 p.drawImage( 0, 0, img ); 239 p.drawImage( 0, 0, img );
240 return new QPixmap( pix ); 240 return new QPixmap( pix );
241} 241}
242 242
243 243
244QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { 244QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) {
245 QPixmap *pixmap = new QPixmap( pix ); 245 QPixmap *pixmap = new QPixmap( pix );
246 pixmap->setMask( mask ); 246 pixmap->setMask( mask );
247 return pixmap; 247 return pixmap;
248} 248}
249 249
250}; 250};
251 251
252void AudioWidget::resizeEvent( QResizeEvent * ) { 252void AudioWidget::resizeEvent( QResizeEvent * ) {
253 int h = height(); 253 int h = height();
254 int w = width(); 254 int w = width();
255 255
256 songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); 256 songInfo.setGeometry( QRect( 2, 2, w - 4, 20 ) );
257 slider.setFixedWidth( w - 110 ); 257 slider.setFixedWidth( w - 110 );
258 slider.setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); 258 slider.setGeometry( QRect( 15, h - 22, w - 90, 20 ) );
259 slider.setBackgroundOrigin( QWidget::ParentOrigin ); 259 slider.setBackgroundOrigin( QWidget::ParentOrigin );
260 time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); 260 time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) );
261 261
262 xoff = ( w - imgUp->width() ) / 2; 262 xoff = ( w - imgUp->width() ) / 2;
263 yoff = (( h - imgUp->height() ) / 2) - 10; 263 yoff = (( h - imgUp->height() ) / 2) - 10;
264 QPoint p( xoff, yoff ); 264 QPoint p( xoff, yoff );
265 265
266 QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p ); 266 QPixmap *pixUp = combineImageWithBackground( *imgUp, *pixBg, p );
267 QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p ); 267 QPixmap *pixDn = combineImageWithBackground( *imgDn, *pixBg, p );
268 268
269 for ( int i = 0; i < 10; i++ ) { 269 for ( int i = 0; i < 10; i++ ) {
270 if ( !masks[i]->isNull() ) { 270 if ( !masks[i]->isNull() ) {
271 delete buttonPixUp[i]; 271 delete buttonPixUp[i];
272 delete buttonPixDown[i]; 272 delete buttonPixDown[i];
273 buttonPixUp[i] = maskPixToMask( *pixUp, *masks[i] ); 273 buttonPixUp[i] = maskPixToMask( *pixUp, *masks[i] );
274 buttonPixDown[i] = maskPixToMask( *pixDn, *masks[i] ); 274 buttonPixDown[i] = maskPixToMask( *pixDn, *masks[i] );
275 } 275 }
276 } 276 }
277 277
278 delete pixUp; 278 delete pixUp;
279 delete pixDn; 279 delete pixDn;
280} 280}
281 281
282static bool audioSliderBeingMoved = FALSE; 282static bool audioSliderBeingMoved = FALSE;