mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
Rename Fancy style to SingleColumn and use it for ColumnView's model.
This commit is contained in:
parent
21e2aecd2b
commit
f6a8b81298
@ -135,7 +135,7 @@ ColumnView::setTreeModel( TreeModel* model )
|
||||
|
||||
guid(); // this will set the guid on the header
|
||||
|
||||
if ( m_proxyModel->style() == PlayableProxyModel::Fancy )
|
||||
if ( m_proxyModel->style() == PlayableProxyModel::SingleColumn )
|
||||
{
|
||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ ContextView::ContextView( QWidget* parent, const QString& caption )
|
||||
{
|
||||
TrackItemDelegate* del = new TrackItemDelegate( TrackItemDelegate::LovedTracks, m_trackView, m_trackView->proxyModel() );
|
||||
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() ) );
|
||||
TomahawkStyle::styleScrollBar( m_trackView->verticalScrollBar() );
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
InboxView::InboxView( QWidget* parent ) :
|
||||
TrackView( parent )
|
||||
{
|
||||
proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
|
||||
|
||||
TrackView::setGuid( "inbox" );
|
||||
setHeaderHidden( true );
|
||||
|
@ -48,10 +48,10 @@ PlayableProxyModel::PlayableProxyModel( QObject* parent )
|
||||
|
||||
PlayableProxyModel::setSourcePlayableModel( NULL );
|
||||
|
||||
m_headerStyle[ Fancy ] << 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[ 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[ 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[ 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;
|
||||
}
|
||||
|
||||
|
||||
@ -603,7 +603,7 @@ PlayableProxyModel::columnCount( const QModelIndex& parent ) const
|
||||
|
||||
switch ( m_style )
|
||||
{
|
||||
case Fancy:
|
||||
case SingleColumn:
|
||||
return 1;
|
||||
break;
|
||||
|
||||
@ -669,7 +669,7 @@ PlayableProxyModel::columnWeights() const
|
||||
|
||||
switch ( m_style )
|
||||
{
|
||||
case Fancy:
|
||||
case SingleColumn:
|
||||
w << 1.0;
|
||||
break;
|
||||
|
||||
@ -708,10 +708,10 @@ PlayableProxyModel::updateDetailedInfo( const QModelIndex& index )
|
||||
{
|
||||
item->query()->track()->cover( QSize( 0, 0 ) );
|
||||
|
||||
if ( style() == PlayableProxyModel::Fancy )
|
||||
/* if ( style() == PlayableProxyModel::Fancy )
|
||||
{
|
||||
item->query()->track()->loadSocialActions();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ Q_OBJECT
|
||||
|
||||
public:
|
||||
enum PlayableItemStyle
|
||||
{ Detailed = 0, Fancy = 1, Collection = 2, Locker = 3 };
|
||||
{ Detailed = 0, SingleColumn = 1, Collection = 2, Locker = 3 };
|
||||
|
||||
enum PlayableProxyModelRole
|
||||
{ StyleRole = Qt::UserRole + 1, TypeRole };
|
||||
|
@ -102,7 +102,7 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel
|
||||
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;
|
||||
size.setHeight( rowHeight );
|
||||
@ -857,7 +857,7 @@ PlaylistItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, con
|
||||
}
|
||||
else if ( hoveringInfo )
|
||||
{
|
||||
if ( m_model->style() == PlayableProxyModel::Fancy )
|
||||
if ( m_model->style() == PlayableProxyModel::SingleColumn )
|
||||
{
|
||||
if ( item->query() )
|
||||
ViewManager::instance()->show( item->query()->track()->toQuery() );
|
||||
|
@ -39,7 +39,7 @@ QueueView::QueueView( QWidget* parent )
|
||||
view()->setCaption( tr( "Queue Details" ) );
|
||||
|
||||
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()->setUniformRowHeights( false );
|
||||
|
||||
|
@ -229,7 +229,7 @@ TrackView::setPlayableModel( PlayableModel* model )
|
||||
|
||||
switch( m_proxyModel->style() )
|
||||
{
|
||||
case PlayableProxyModel::Fancy:
|
||||
case PlayableProxyModel::SingleColumn:
|
||||
setHeaderHidden( true );
|
||||
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
break;
|
||||
|
@ -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 );
|
||||
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 )
|
||||
{
|
||||
|
@ -50,13 +50,13 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget*
|
||||
ui->splitter->setStretchFactor( 1, 1 );
|
||||
|
||||
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->sortByColumn( PlayableModel::Age, Qt::DescendingOrder );
|
||||
m_recentTracksModel->setSource( source );
|
||||
|
||||
m_historyModel = new RecentlyPlayedModel( ui->historyView );
|
||||
ui->historyView->proxyModel()->setStyle( PlayableProxyModel::Fancy );
|
||||
ui->historyView->proxyModel()->setStyle( PlayableProxyModel::SingleColumn );
|
||||
ui->historyView->setPlayableModel( m_historyModel );
|
||||
m_historyModel->setSource( source );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user