mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerartists.cpp
changeset 43 0f32e550d9d8
parent 37 eb79a7c355bf
child 51 560ce2306a17
equal deleted inserted replaced
38:b93f525c9244 43:0f32e550d9d8
    19 
    19 
    20 #include <hbdocumentloader.h>
    20 #include <hbdocumentloader.h>
    21 #include <hblistview.h>
    21 #include <hblistview.h>
    22 #include <hbgroupbox.h>
    22 #include <hbgroupbox.h>
    23 #include <hbindexfeedback.h>
    23 #include <hbindexfeedback.h>
       
    24 #include <hbparameterlengthlimiter.h>
    24 
    25 
    25 #include <hgmediawall.h>
    26 #include <hgmediawall.h>
    26 
    27 
    27 #include "mpcollectioncontainerartists.h"
    28 #include "mpcollectioncontainerartists.h"
    28 #include "mpmpxcollectiondata.h"
    29 #include "mpmpxcollectiondata.h"
   201 }
   202 }
   202 
   203 
   203 /*!
   204 /*!
   204  Slot to be called when scrolling ends in media wall and an album is centered.
   205  Slot to be called when scrolling ends in media wall and an album is centered.
   205  */
   206  */
   206 void MpCollectionContainerArtists::albumCentered()
   207 void MpCollectionContainerArtists::albumCentered( const QModelIndex &modelIndex )
   207 {
   208 {
   208     TX_ENTRY
   209     TX_ENTRY
   209     int index = mTBone->currentIndex().row();
   210     int index = modelIndex.row();
   210     TX_LOG_ARGS("index=" << index);
   211     TX_LOG_ARGS("index=" << index);
   211     index += mAlbumIndexOffset;
   212     index += mAlbumIndexOffset;
   212     if ( mCurrentAlbumIndex != index ) {
   213     if ( mCurrentAlbumIndex != index ) {
   213         // Prevent reloading if user just moves the center album a little
   214         // Prevent reloading if user just moves the center album a little
   214         // and the same album re-centers.
   215         // and the same album re-centers.
   384                 widget = mDocumentLoader->findWidget(QString("artistAlbumWall"));
   385                 widget = mDocumentLoader->findWidget(QString("artistAlbumWall"));
   385                 mTBone = qobject_cast<HgMediawall*>(widget);
   386                 mTBone = qobject_cast<HgMediawall*>(widget);
   386                 HbIcon defaultIcon( "qtg_large_album_art" );
   387                 HbIcon defaultIcon( "qtg_large_album_art" );
   387                 defaultIcon.setSize(mTBone->itemSize());
   388                 defaultIcon.setSize(mTBone->itemSize());
   388                 mTBone->setDefaultImage( defaultIcon.pixmap().toImage() );
   389                 mTBone->setDefaultImage( defaultIcon.pixmap().toImage() );
   389                 mTBone->setTitleFontSpec( HbFontSpec(HbFontSpec::Primary) );
       
   390                 mTBone->setDescriptionFontSpec( HbFontSpec(HbFontSpec::Secondary) );
       
   391                 mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff );
   390                 mTBone->setScrollBarPolicy( HgWidget::ScrollBarAlwaysOff );
   392                 mTBone->enableReflections(true);
   391                 mTBone->enableReflections(true);
   393                 connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) );
   392                 connect( mTBone, SIGNAL(scrollingStarted()), this, SLOT(scrollingStarted()) );
   394                 connect( mTBone, SIGNAL(scrollingEnded()), this, SLOT(albumCentered()) );
   393                 connect( mTBone, SIGNAL(animationAboutToEnd(QModelIndex)), this, SLOT(albumCentered(QModelIndex)) );
   395                 }
   394                 }
   396                 break;
   395                 break;
   397             case ECollectionContextArtistAllSongs:
   396             case ECollectionContextArtistAllSongs:
   398                 // No need to load anything. Just reuse the section "artistAlbums" loaded
   397                 // No need to load anything. Just reuse the section "artistAlbums" loaded
   399                 // in ECollectionContextArtistAlbums context.
   398                 // in ECollectionContextArtistAlbums context.
   404                     artist = mCollectionData->collectionTitle();
   403                     artist = mCollectionData->collectionTitle();
   405                     if ( artist.isEmpty() ) {
   404                     if ( artist.isEmpty() ) {
   406                         artist = hbTrId("txt_mus_subtitle_unknown_all");
   405                         artist = hbTrId("txt_mus_subtitle_unknown_all");
   407                     }
   406                     }
   408                     else {
   407                     else {
   409                         artist = hbTrId("txt_mus_subtitle_1_all").arg(artist);
   408                         artist = HbParameterLengthLimiter(hbTrId("txt_mus_subtitle_1_all")).arg(artist);
   410                     }
   409                     }
   411                     mInfoBar->setHeading(artist);
   410                     mInfoBar->setHeading(artist);
   412                 }
   411                 }
   413                 break;
   412                 break;
   414             default:
   413             default: