mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 05:07:27 +02:00
* Lower opacity for disabled items.
This commit is contained in:
@@ -135,9 +135,7 @@ SourceDelegate::paintStandardItem( QPainter* painter, const QStyleOptionViewItem
|
|||||||
|
|
||||||
QIcon::Mode iconMode = QIcon::Normal;
|
QIcon::Mode iconMode = QIcon::Normal;
|
||||||
if ( !enabled )
|
if ( !enabled )
|
||||||
{
|
|
||||||
iconMode = QIcon::Disabled;
|
iconMode = QIcon::Disabled;
|
||||||
}
|
|
||||||
|
|
||||||
QRect iconRect = opt.rect.adjusted( 14, 4, 0, -4 );
|
QRect iconRect = opt.rect.adjusted( 14, 4, 0, -4 );
|
||||||
iconRect.setWidth( iconRect.height() );
|
iconRect.setWidth( iconRect.height() );
|
||||||
@@ -147,7 +145,6 @@ SourceDelegate::paintStandardItem( QPainter* painter, const QStyleOptionViewItem
|
|||||||
{
|
{
|
||||||
QFont f = painter->font();
|
QFont f = painter->font();
|
||||||
f.setBold( true );
|
f.setBold( true );
|
||||||
// f.setPointSize( 10 );
|
|
||||||
painter->setFont( f );
|
painter->setFont( f );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,14 +153,11 @@ SourceDelegate::paintStandardItem( QPainter* painter, const QStyleOptionViewItem
|
|||||||
{
|
{
|
||||||
QTextOption to( Qt::AlignVCenter );
|
QTextOption to( Qt::AlignVCenter );
|
||||||
to.setWrapMode( QTextOption::NoWrap );
|
to.setWrapMode( QTextOption::NoWrap );
|
||||||
|
painter->setPen( Qt::black );
|
||||||
|
|
||||||
if ( !enabled && !selected )
|
if ( !enabled && !selected )
|
||||||
{
|
{
|
||||||
painter->setPen( opt.palette.color( QPalette::Disabled, QPalette::Text ) );
|
painter->setOpacity( 0.4 );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
painter->setPen( Qt::black );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
painter->drawText( textRect, text, to );
|
painter->drawText( textRect, text, to );
|
||||||
|
Reference in New Issue
Block a user