1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Fixed alignment of playlist headers.

This commit is contained in:
Christian Muehlhaeuser 2012-01-23 03:20:49 +01:00
parent 9f99108701
commit fdb13a1f78
2 changed files with 28 additions and 14 deletions

View File

@ -138,20 +138,7 @@ TrackModel::data( const QModelIndex& index, int role ) const
if ( role == Qt::TextAlignmentRole )
{
switch( index.column() )
{
case Age:
case AlbumPos:
case Bitrate:
case Duration:
case Filesize:
case Year:
return Qt::AlignHCenter;
break;
default:
return Qt::AlignLeft;
}
return QVariant( columnAlignment( index.column() ) );
}
if ( role == StyleRole )
@ -262,6 +249,11 @@ TrackModel::headerData( int section, Qt::Orientation orientation, int role ) con
return headers.at( section );
}
if ( role == Qt::TextAlignmentRole )
{
return QVariant( columnAlignment( section ) );
}
return QVariant();
}
@ -560,3 +552,23 @@ TrackModel::setStyle( TrackModel::TrackItemStyle style )
{
m_style = style;
}
Qt::Alignment
TrackModel::columnAlignment( int column ) const
{
switch( column )
{
case Age:
case AlbumPos:
case Bitrate:
case Duration:
case Filesize:
case Year:
return Qt::AlignHCenter;
break;
default:
return Qt::AlignLeft;
}
}

View File

@ -136,6 +136,8 @@ private slots:
void onPlaybackStopped();
private:
Qt::Alignment columnAlignment( int column ) const;
TrackModelItem* m_rootItem;
QPersistentModelIndex m_currentIndex;
Tomahawk::QID m_currentUuid;