mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
* A few ColumnItemDelegate fixes.
This commit is contained in:
@@ -222,7 +222,7 @@ ColumnItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option
|
|||||||
painter->setRenderHint( QPainter::Antialiasing );
|
painter->setRenderHint( QPainter::Antialiasing );
|
||||||
painter->setPen( opt.palette.color( QPalette::Text ) );
|
painter->setPen( opt.palette.color( QPalette::Text ) );
|
||||||
|
|
||||||
QRect r = option.rect.adjusted( 4, 4, -option.rect.width() + option.rect.height() - 4, -4 );
|
QRect r = option.rect.adjusted( 8, 2, -option.rect.width() + option.rect.height() + 4, -2 );
|
||||||
// painter->drawPixmap( r, QPixmap( RESPATH "images/cover-shadow.png" ) );
|
// painter->drawPixmap( r, QPixmap( RESPATH "images/cover-shadow.png" ) );
|
||||||
|
|
||||||
if ( !m_pixmaps.contains( index ) )
|
if ( !m_pixmaps.contains( index ) )
|
||||||
@@ -244,7 +244,12 @@ ColumnItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option
|
|||||||
const QPixmap cover = m_pixmaps[ index ]->currentPixmap();
|
const QPixmap cover = m_pixmaps[ index ]->currentPixmap();
|
||||||
painter->drawPixmap( r, cover );
|
painter->drawPixmap( r, cover );
|
||||||
|
|
||||||
r = option.rect.adjusted( option.rect.height(), 6, -4, -option.rect.height() + 22 );
|
QFont font = painter->font();
|
||||||
|
// font.setWeight( 58 );
|
||||||
|
font.setPointSize( TomahawkUtils::defaultFontSize() + 2 );
|
||||||
|
painter->setFont( font );
|
||||||
|
|
||||||
|
r = option.rect.adjusted( option.rect.height() + 16, 6, -4, -6 );
|
||||||
text = painter->fontMetrics().elidedText( text, Qt::ElideRight, r.width() );
|
text = painter->fontMetrics().elidedText( text, Qt::ElideRight, r.width() );
|
||||||
painter->drawText( r, text, textOption );
|
painter->drawText( r, text, textOption );
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>348</width>
|
<width>300</width>
|
||||||
<height>500</height>
|
<height>500</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>348</width>
|
<width>300</width>
|
||||||
<height>500</height>
|
<height>500</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
Reference in New Issue
Block a user