1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-17 19:37:09 +02:00

Fixed font setting bug and use less margin.

This commit is contained in:
Christian Muehlhaeuser
2014-11-04 17:01:58 +01:00
parent 96db4bb120
commit 46ac9d46ee

View File

@@ -61,8 +61,8 @@ GridItemDelegate::GridItemDelegate( QAbstractItemView* parent, PlayableProxyMode
if ( m_view && m_view->metaObject()->indexOfSignal( "modelChanged()" ) > -1 )
connect( m_view, SIGNAL( modelChanged() ), this, SLOT( modelChanged() ) );
QFont m_font = m_view->font();
QFont m_smallFont = m_font;
m_font = m_view->font();
m_smallFont = m_font;
m_font.setPointSize( TomahawkUtils::defaultFontSize() + 2 );
m_smallFont.setPointSize( TomahawkUtils::defaultFontSize() );
@@ -91,9 +91,9 @@ GridItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelInde
const QFontMetrics fms( m_smallFont );
if ( !m_wordWrapping )
return QSize( m_itemWidth, m_itemWidth + fm.height() + m_margin );
return QSize( m_itemWidth, m_itemWidth + fm.height() + m_margin * 0.8 );
return QSize( m_itemWidth, m_itemWidth + fm.height() + fms.height() + m_margin );
return QSize( m_itemWidth, m_itemWidth + fm.height() + fms.height() + m_margin * 0.8 );
}
}