author | llornkcor <llornkcor> | 2002-02-25 05:10:32 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-25 05:10:32 (UTC) |
commit | 1bebd27631a6c9d1ab967cbb32dd4e796b3b0402 (patch) (unidiff) | |
tree | 8ce49800cba26f6f2c33de74a71d4efe0338843f /core/multimedia/opieplayer/playlistselection.cpp | |
parent | d948361c1b475fab4660b28fbf5ec21fd34d923f (diff) | |
download | opie-1bebd27631a6c9d1ab967cbb32dd4e796b3b0402.zip opie-1bebd27631a6c9d1ab967cbb32dd4e796b3b0402.tar.gz opie-1bebd27631a6c9d1ab967cbb32dd4e796b3b0402.tar.bz2 |
fixed 2
Diffstat (limited to 'core/multimedia/opieplayer/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 49 |
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 | |||
@@ -34,6 +34,6 @@ class PlayListSelectionItem : public QListViewItem { | |||
34 | public: | 34 | 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 | } |
39 | 39 | ||
@@ -51,8 +51,10 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | |||
51 | : QListView( parent, name ) | 51 | : QListView( parent, 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 ); |
58 | addColumn( tr( "Playlist Selection" ) ); | 60 | addColumn( tr( "Playlist Selection" ) ); |
@@ -66,22 +68,23 @@ PlayListSelection::~PlayListSelection() { | |||
66 | 68 | ||
67 | 69 | ||
68 | #ifdef USE_PLAYLIST_BACKGROUND | 70 | // #ifdef USE_PLAYLIST_BACKGROUND |
69 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { | 71 | void 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 | ||
77 | 80 | ||
78 | void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { | 81 | 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 | } |
87 | } | 90 | } |
@@ -91,5 +94,5 @@ const DocLnk *PlayListSelection::current() { | |||
91 | PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem(); | 94 | PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem(); |
92 | if ( item ) | 95 | if ( item ) |
93 | return item->file(); | 96 | return item->file(); |
94 | return NULL; | 97 | return NULL; |
95 | } | 98 | } |
@@ -109,5 +112,5 @@ void PlayListSelection::removeSelected() { | |||
109 | QListViewItem *item = selectedItem(); | 112 | QListViewItem *item = selectedItem(); |
110 | if ( item ) | 113 | if ( item ) |
111 | delete item; | 114 | delete item; |
112 | setSelected( currentItem(), TRUE ); | 115 | setSelected( currentItem(), TRUE ); |
113 | ensureItemVisible( selectedItem() ); | 116 | ensureItemVisible( selectedItem() ); |
@@ -118,5 +121,5 @@ void PlayListSelection::moveSelectedUp() { | |||
118 | QListViewItem *item = selectedItem(); | 121 | QListViewItem *item = selectedItem(); |
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() ); |
122 | } | 125 | } |
@@ -136,5 +139,5 @@ bool PlayListSelection::prev() { | |||
136 | setSelected( item->itemAbove(), TRUE ); | 139 | setSelected( item->itemAbove(), TRUE ); |
137 | else | 140 | else |
138 | return FALSE; | 141 | return FALSE; |
139 | ensureItemVisible( selectedItem() ); | 142 | ensureItemVisible( selectedItem() ); |
140 | return TRUE; | 143 | return TRUE; |
@@ -147,5 +150,5 @@ bool PlayListSelection::next() { | |||
147 | setSelected( item->itemBelow(), TRUE ); | 150 | setSelected( item->itemBelow(), TRUE ); |
148 | else | 151 | else |
149 | return FALSE; | 152 | return FALSE; |
150 | ensureItemVisible( selectedItem() ); | 153 | ensureItemVisible( selectedItem() ); |
151 | return TRUE; | 154 | return TRUE; |
@@ -158,5 +161,5 @@ bool PlayListSelection::first() { | |||
158 | setSelected( item, TRUE ); | 161 | setSelected( item, TRUE ); |
159 | else | 162 | else |
160 | return FALSE; | 163 | return FALSE; |
161 | ensureItemVisible( selectedItem() ); | 164 | ensureItemVisible( selectedItem() ); |
162 | return TRUE; | 165 | return TRUE; |
@@ -168,9 +171,9 @@ bool PlayListSelection::last() { | |||
168 | QListViewItem *item = firstChild(); | 171 | QListViewItem *item = firstChild(); |
169 | while ( ( item = item->nextSibling() ) ) | 172 | while ( ( item = item->nextSibling() ) ) |
170 | prevItem = item; | 173 | prevItem = item; |
171 | if ( prevItem ) | 174 | if ( prevItem ) |
172 | setSelected( prevItem, TRUE ); | 175 | setSelected( prevItem, TRUE ); |
173 | else | 176 | else |
174 | return FALSE; | 177 | return FALSE; |
175 | ensureItemVisible( selectedItem() ); | 178 | ensureItemVisible( selectedItem() ); |
176 | return TRUE; | 179 | return TRUE; |