mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +02:00
fix info icon with different DPIs
This commit is contained in:
@@ -72,6 +72,9 @@ PlaylistItemDelegate::sizeHint( const QStyleOptionViewItem& option, const QModel
|
|||||||
{
|
{
|
||||||
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 ) {
|
||||||
|
int rowHeight = option.fontMetrics.height() * 1.4;
|
||||||
|
size.setHeight( rowHeight );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +233,7 @@ PlaylistItemDelegate::paintDetailed( QPainter* painter, const QStyleOptionViewIt
|
|||||||
if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() && !index.data().toString().isEmpty() &&
|
if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() && !index.data().toString().isEmpty() &&
|
||||||
( index.column() == PlayableModel::Artist || index.column() == PlayableModel::Album || index.column() == PlayableModel::Track ) )
|
( index.column() == PlayableModel::Artist || index.column() == PlayableModel::Album || index.column() == PlayableModel::Track ) )
|
||||||
{
|
{
|
||||||
opt.rect.setWidth( opt.rect.width() - 16 );
|
opt.rect.setWidth( opt.rect.width() - opt.rect.height() - 2 );
|
||||||
QRect arrowRect( opt.rect.x() + opt.rect.width(), opt.rect.y() + 1, opt.rect.height() - 2, opt.rect.height() - 2 );
|
QRect arrowRect( opt.rect.x() + opt.rect.width(), opt.rect.y() + 1, opt.rect.height() - 2, opt.rect.height() - 2 );
|
||||||
|
|
||||||
QPixmap infoIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::InfoIcon, TomahawkUtils::Original, arrowRect.size() );
|
QPixmap infoIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::InfoIcon, TomahawkUtils::Original, arrowRect.size() );
|
||||||
|
Reference in New Issue
Block a user