1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02: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 ); QSize size = QStyledItemDelegate::sizeHint( option, index );
if ( index.isValid() )
{ {
int style = index.data( PlayableProxyModel::StyleRole ).toInt(); if ( m_model->style() == PlayableProxyModel::Short || m_model->style() == PlayableProxyModel::ShortWithAvatars )
if ( style == PlayableProxyModel::Short || style == PlayableProxyModel::ShortWithAvatars )
{ {
int rowHeight = option.fontMetrics.height() + 8; int rowHeight = option.fontMetrics.height() + 8;
size.setHeight( rowHeight * 2 ); 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 ); size.setHeight( rowHeight );
} }
} }

View File

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