1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 06:36:55 +02:00

Rename Fancy style to SingleColumn and use it for ColumnView's model.

This commit is contained in:
Christian Muehlhaeuser
2015-04-10 06:57:30 +02:00
parent 21e2aecd2b
commit f6a8b81298
10 changed files with 19 additions and 19 deletions

View File

@@ -135,7 +135,7 @@ ColumnView::setTreeModel( TreeModel* model )
guid(); // this will set the guid on the header guid(); // this will set the guid on the header
if ( m_proxyModel->style() == PlayableProxyModel::Fancy ) if ( m_proxyModel->style() == PlayableProxyModel::SingleColumn )
{ {
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
} }

View File

@@ -47,7 +47,7 @@ ContextView::ContextView( QWidget* parent, const QString& caption )
{ {
TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() ); TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() );
m_trackView->setPlaylistItemDelegate( del ); m_trackView->setPlaylistItemDelegate( del );
m_trackView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); m_trackView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
m_trackView->setStyleSheet( QString( "QTreeView { background-color: %1; }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() ) ); m_trackView->setStyleSheet( QString( "QTreeView { background-color: %1; }" ).arg( TomahawkStyle::PAGE_BACKGROUND.name() ) );
TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() ); TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() );

View File

@@ -32,7 +32,7 @@
InboxView::InboxView( QWidget* parent ) : InboxView::InboxView( QWidget* parent ) :
TrackView( parent ) TrackView( parent )
{ {
proxyModel()->setStyle( PlayableProxyModel::Fancy ); proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
TrackView::setGuid( "inbox" ); TrackView::setGuid( "inbox" );
setHeaderHidden( true ); setHeaderHidden( true );

View File

@@ -48,7 +48,7 @@ PlayableProxyModel::PlayableProxyModel( QObject* parent )
PlayableProxyModel::setSourcePlayableModel( NULL ); PlayableProxyModel::setSourcePlayableModel( NULL );
m_headerStyle[ Fancy ] << PlayableModel::Name; m_headerStyle[ SingleColumn ] << PlayableModel::Name;
m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score; m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score;
m_headerStyle[ Collection ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize; m_headerStyle[ Collection ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize;
m_headerStyle[ Locker ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::Download << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize; m_headerStyle[ Locker ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::Download << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize;
@@ -603,7 +603,7 @@ PlayableProxyModel::columnCount( const QModelIndex& parent ) const
switch ( m_style ) switch ( m_style )
{ {
case Fancy: case SingleColumn:
return 1; return 1;
break; break;
@@ -669,7 +669,7 @@ PlayableProxyModel::columnWeights() const
switch ( m_style ) switch ( m_style )
{ {
case Fancy: case SingleColumn:
w << 1.0; w << 1.0;
break; break;
@@ -708,10 +708,10 @@ PlayableProxyModel::updateDetailedInfo( const QModelIndex& index )
{ {
item->query()->track()->cover( QSize( 0, 0 ) ); item->query()->track()->cover( QSize( 0, 0 ) );
if ( style() == PlayableProxyModel::Fancy ) /* if ( style() == PlayableProxyModel::Fancy )
{ {
item->query()->track()->loadSocialActions(); item->query()->track()->loadSocialActions();
} }*/
} }
} }

View File

@@ -47,7 +47,7 @@ Q_OBJECT
public: public:
enum PlayableItemStyle enum PlayableItemStyle
{ Detailed = 0, Fancy = 1, Collection = 2, Locker = 3 }; { Detailed = 0, SingleColumn = 1, Collection = 2, Locker = 3 };
enum PlayableProxyModelRole enum PlayableProxyModelRole
{ StyleRole = Qt::UserRole + 1, TypeRole }; { StyleRole = Qt::UserRole + 1, TypeRole };

View File

@@ -102,7 +102,7 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel
QSize size = QStyledItemDelegate::sizeHint( option, index ); QSize size = QStyledItemDelegate::sizeHint( option, index );
{ {
if ( m_model->style() != PlayableProxyModel::Fancy ) if ( m_model->style() != PlayableProxyModel::SingleColumn )
{ {
int rowHeight = option.fontMetrics.height() * 1.6; int rowHeight = option.fontMetrics.height() * 1.6;
size.setHeight( rowHeight ); size.setHeight( rowHeight );
@@ -857,7 +857,7 @@ PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, con
} }
else if ( hoveringInfo ) else if ( hoveringInfo )
{ {
if ( m_model->style() == PlayableProxyModel::Fancy ) if ( m_model->style() == PlayableProxyModel::SingleColumn )
{ {
if ( item->query() ) if ( item->query() )
ViewManager::instance()->show( item->query()->track()->toQuery() ); ViewManager::instance()->show( item->query()->track()->toQuery() );

View File

@@ -39,7 +39,7 @@ QueueView::QueueView( QWidget* parent )
view()->setCaption( tr( "Queue Details" ) ); view()->setCaption( tr( "Queue Details" ) );
view()->trackView()->setProxyModel( new QueueProxyModel( view()->trackView() ) ); view()->trackView()->setProxyModel( new QueueProxyModel( view()->trackView() ) );
view()->trackView()->proxyModel()->setStyle( PlayableProxyModel::Fancy ); view()->trackView()->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
view()->trackView()->setHeaderHidden( true ); view()->trackView()->setHeaderHidden( true );
view()->trackView()->setUniformRowHeights( false ); view()->trackView()->setUniformRowHeights( false );

View File

@@ -229,7 +229,7 @@ TrackView::setPlayableModel( PlayableModel* model )
switch( m_proxyModel->style() ) switch( m_proxyModel->style() )
{ {
case PlayableProxyModel::Fancy: case PlayableProxyModel::SingleColumn:
setHeaderHidden( true ); setHeaderHidden( true );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
break; break;

View File

@@ -60,7 +60,7 @@ CollectionViewPage::CollectionViewPage( const Tomahawk::collection_ptr& collecti
m_header->setBackground( ImageRegistry::instance()->pixmap( RESPATH "images/collection_background.png", QSize( 0, 0 ) ), false ); m_header->setBackground( ImageRegistry::instance()->pixmap( RESPATH "images/collection_background.png", QSize( 0, 0 ) ), false );
setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultCollection, TomahawkUtils::Original, QSize( 256, 256 ) ) ); setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultCollection, TomahawkUtils::Original, QSize( 256, 256 ) ) );
m_columnView->proxyModel()->setStyle( PlayableProxyModel::Collection ); m_columnView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
if ( collection->backendType() == Collection::ScriptCollectionType ) if ( collection->backendType() == Collection::ScriptCollectionType )
{ {

View File

@@ -50,13 +50,13 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget*
ui->splitter->setStretchFactor( 1, 1 ); ui->splitter->setStretchFactor( 1, 1 );
m_recentTracksModel = new RecentlyAddedModel( ui->recentCollectionView ); m_recentTracksModel = new RecentlyAddedModel( ui->recentCollectionView );
ui->recentCollectionView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); ui->recentCollectionView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
ui->recentCollectionView->setPlayableModel( m_recentTracksModel ); ui->recentCollectionView->setPlayableModel( m_recentTracksModel );
ui->recentCollectionView->sortByColumn( PlayableModel::Age, Qt::DescendingOrder ); ui->recentCollectionView->sortByColumn( PlayableModel::Age, Qt::DescendingOrder );
m_recentTracksModel->setSource( source ); m_recentTracksModel->setSource( source );
m_historyModel = new RecentlyPlayedModel( ui->historyView ); m_historyModel = new RecentlyPlayedModel( ui->historyView );
ui->historyView->proxyModel()->setStyle( PlayableProxyModel::Fancy ); ui->historyView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
ui->historyView->setPlayableModel( m_historyModel ); ui->historyView->setPlayableModel( m_historyModel );
m_historyModel->setSource( source ); m_historyModel->setSource( source );