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:
parent
203f38cf2d
commit
3d210c05e5
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user