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:
@@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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 );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user