138 } |
138 } |
139 |
139 |
140 /*! |
140 /*! |
141 Slot to be called when scrolling ends in media wall and an album is centered. |
141 Slot to be called when scrolling ends in media wall and an album is centered. |
142 */ |
142 */ |
143 void MpCollectionContainerAlbums::albumCentered() |
143 void MpCollectionContainerAlbums::albumCentered( const QModelIndex &index ) |
144 { |
144 { |
145 TX_ENTRY |
145 TX_ENTRY |
146 QModelIndex index = mTBone->currentIndex(); |
|
147 if ( mCurrentAlbumIndex != index.row() ) { |
146 if ( mCurrentAlbumIndex != index.row() ) { |
148 // Prevent reloading if user just moves the center album a little |
147 // Prevent reloading if user just moves the center album a little |
149 // and the same album re-centers. |
148 // and the same album re-centers. |
150 mCurrentAlbumIndex = index.row(); |
149 mCurrentAlbumIndex = index.row(); |
151 TX_LOG_ARGS("mCurrentAlbumIndex=" << mCurrentAlbumIndex); |
150 TX_LOG_ARGS("mCurrentAlbumIndex=" << mCurrentAlbumIndex); |
293 widget = mDocumentLoader->findWidget(QString("albumWall")); |
292 widget = mDocumentLoader->findWidget(QString("albumWall")); |
294 mTBone = qobject_cast<HgMediawall*>(widget); |
293 mTBone = qobject_cast<HgMediawall*>(widget); |
295 HbIcon defaultIcon( "qtg_large_album_art" ); |
294 HbIcon defaultIcon( "qtg_large_album_art" ); |
296 defaultIcon.setSize(mTBone->itemSize()); |
295 defaultIcon.setSize(mTBone->itemSize()); |
297 mTBone->setDefaultImage( defaultIcon.pixmap().toImage() ); |
296 mTBone->setDefaultImage( defaultIcon.pixmap().toImage() ); |
298 mTBone->setTitleFontSpec( HbFontSpec(HbFontSpec::Primary) ); |
|
299 mTBone->setDescriptionFontSpec( HbFontSpec(HbFontSpec::Secondary) ); |
|
300 mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff ); |
297 mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff ); |
301 mTBone->enableReflections(true); |
298 mTBone->enableReflections(true); |
302 connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) ); |
299 connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) ); |
303 connect( mTBone, SIGNAL(scrollingEnded()), this, SLOT(albumCentered()) ); |
300 connect( mTBone, SIGNAL(animationAboutToEnd(QModelIndex)), this, SLOT(albumCentered(QModelIndex)) ); |
304 } |
301 } |
305 } |
302 } |
306 else { |
303 else { |
307 // Must delete widgets when last song is deleted and view is reloaded. |
304 // Must delete widgets when last song is deleted and view is reloaded. |
308 if ( mInfoBar ) { |
305 if ( mInfoBar ) { |