summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/playlistselection.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp49
1 files changed, 26 insertions, 23 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index a82b594..2c62e86 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -35,4 +35,4 @@ public:
35 PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) { 35 PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) {
36 setText( 0, f->name() ); 36 setText( 0, f->name() );
37 setPixmap( 0, f->pixmap() ); 37 setPixmap( 0, f->pixmap() );
38 } 38 }
@@ -52,6 +52,8 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
52{ 52{
53#ifdef USE_PLAYLIST_BACKGROUND 53// #ifdef USE_PLAYLIST_BACKGROUND
54 setStaticBackground( TRUE ); 54 setStaticBackground( TRUE );
55 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) ); 55// setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/background" ) );
56#endif 56 setBackgroundPixmap( Resource::loadPixmap( "opielogo" ) );
57// #endif
58 addColumn("Title",236);
57 setAllColumnsShowFocus( TRUE ); 59 setAllColumnsShowFocus( TRUE );
@@ -67,10 +69,11 @@ PlayListSelection::~PlayListSelection() {
67 69
68#ifdef USE_PLAYLIST_BACKGROUND 70// #ifdef USE_PLAYLIST_BACKGROUND
69void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { 71void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
70 p->fillRect( r, QBrush( white ) ); 72 p->fillRect( r, QBrush( white ) );
71 QImage logo = Resource::loadImage( "mpegplayer/background" ); 73// QImage logo = Resource::loadImage( "mpegplayer/background" );
74 QImage logo = Resource::loadImage( "opielogo" );
72 if ( !logo.isNull() ) 75 if ( !logo.isNull() )
73 p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); 76 p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
74} 77}
75#endif 78// #endif
76 79
@@ -79,8 +82,8 @@ void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
79 if ( event->state() == QMouseEvent::LeftButton ) { 82 if ( event->state() == QMouseEvent::LeftButton ) {
80 QListViewItem *currentItem = selectedItem(); 83 QListViewItem *currentItem = selectedItem();
81 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); 84 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
82 if ( currentItem && currentItem->itemAbove() == itemUnder ) 85 if ( currentItem && currentItem->itemAbove() == itemUnder )
83 moveSelectedUp(); 86 moveSelectedUp();
84 else if ( currentItem && currentItem->itemBelow() == itemUnder ) 87 else if ( currentItem && currentItem->itemBelow() == itemUnder )
85 moveSelectedDown(); 88 moveSelectedDown();
86 } 89 }
@@ -92,3 +95,3 @@ const DocLnk *PlayListSelection::current() {
92 if ( item ) 95 if ( item )
93 return item->file(); 96 return item->file();
94 return NULL; 97 return NULL;
@@ -110,3 +113,3 @@ void PlayListSelection::removeSelected() {
110 if ( item ) 113 if ( item )
111 delete item; 114 delete item;
112 setSelected( currentItem(), TRUE ); 115 setSelected( currentItem(), TRUE );
@@ -119,3 +122,3 @@ void PlayListSelection::moveSelectedUp() {
119 if ( item && item->itemAbove() ) 122 if ( item && item->itemAbove() )
120 item->itemAbove()->moveItem( item ); 123 item->itemAbove()->moveItem( item );
121 ensureItemVisible( selectedItem() ); 124 ensureItemVisible( selectedItem() );
@@ -137,3 +140,3 @@ bool PlayListSelection::prev() {
137 else 140 else
138 return FALSE; 141 return FALSE;
139 ensureItemVisible( selectedItem() ); 142 ensureItemVisible( selectedItem() );
@@ -148,3 +151,3 @@ bool PlayListSelection::next() {
148 else 151 else
149 return FALSE; 152 return FALSE;
150 ensureItemVisible( selectedItem() ); 153 ensureItemVisible( selectedItem() );
@@ -159,3 +162,3 @@ bool PlayListSelection::first() {
159 else 162 else
160 return FALSE; 163 return FALSE;
161 ensureItemVisible( selectedItem() ); 164 ensureItemVisible( selectedItem() );
@@ -169,3 +172,3 @@ bool PlayListSelection::last() {
169 while ( ( item = item->nextSibling() ) ) 172 while ( ( item = item->nextSibling() ) )
170 prevItem = item; 173 prevItem = item;
171 if ( prevItem ) 174 if ( prevItem )
@@ -173,3 +176,3 @@ bool PlayListSelection::last() {
173 else 176 else
174 return FALSE; 177 return FALSE;
175 ensureItemVisible( selectedItem() ); 178 ensureItemVisible( selectedItem() );