1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 00:09:47 +01:00

* Fixed default row-height for PlaylistItemDelegate.

This commit is contained in:
Christian Muehlhaeuser 2012-12-23 18:52:11 +01:00
parent 203f38cf2d
commit 3d210c05e5
2 changed files with 4 additions and 6 deletions

View File

@ -65,17 +65,15 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel
{
QSize size = QStyledItemDelegate::sizeHint( option, index );
if ( index.isValid() )
{
int style = index.data( PlayableProxyModel::StyleRole ).toInt();
if ( style == PlayableProxyModel::Short || style == PlayableProxyModel::ShortWithAvatars )
if ( m_model->style() == PlayableProxyModel::Short || m_model->style() == PlayableProxyModel::ShortWithAvatars )
{
int rowHeight = option.fontMetrics.height() + 8;
size.setHeight( rowHeight * 2 );
}
else if ( style == PlayableProxyModel::Detailed )
else if ( m_model->style() == PlayableProxyModel::Detailed )
{
int rowHeight = option.fontMetrics.height() * 1.4;
int rowHeight = option.fontMetrics.height() * 1.6;
size.setHeight( rowHeight );
}
}

View File

@ -34,7 +34,7 @@ class DLLEXPORT PlaylistItemDelegate : public QStyledItemDelegate
Q_OBJECT
public:
PlaylistItemDelegate( TrackView* parent = 0, PlayableProxyModel* proxy = 0 );
PlaylistItemDelegate( TrackView* parent, PlayableProxyModel* proxy );
void updateRowSize( const QModelIndex& index );