mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
* Fixed Show/Hide label alignment in sidebar.
This commit is contained in:
parent
372e0caef2
commit
ba53cfe548
@ -391,7 +391,7 @@ SourceDelegate::paintCategory( QPainter* painter, const QStyleOptionViewItem& op
|
||||
|
||||
painter->setPen( Qt::black );
|
||||
painter->setOpacity( 0.5 );
|
||||
painter->drawText( option.rect.translated( m_margin / 2, 0 ), index.data().toString().toUpper(), QTextOption( Qt::AlignVCenter ) );
|
||||
painter->drawText( option.rect.adjusted( m_margin / 2, 0, -m_margin, 0 ), index.data().toString().toUpper(), QTextOption( Qt::AlignVCenter ) );
|
||||
|
||||
if ( option.state & QStyle::State_MouseOver )
|
||||
{
|
||||
@ -399,11 +399,9 @@ SourceDelegate::paintCategory( QPainter* painter, const QStyleOptionViewItem& op
|
||||
if ( option.state & QStyle::State_Open )
|
||||
text = tr( "Hide" );
|
||||
|
||||
painter->setFont( option.font );
|
||||
|
||||
// draw close icon
|
||||
painter->setPen( TomahawkStyle::GROUP_HEADER );
|
||||
painter->drawText( option.rect.translated( -m_margin / 8, 0 ), text, QTextOption( Qt::AlignVCenter | Qt::AlignRight ) );
|
||||
painter->drawText( option.rect.translated( -m_margin / 4, 0 ), text, QTextOption( Qt::AlignVCenter | Qt::AlignRight ) );
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
@ -429,11 +427,9 @@ SourceDelegate::paintGroup( QPainter* painter, const QStyleOptionViewItem& optio
|
||||
if ( option.state & QStyle::State_Open )
|
||||
text = tr( "Hide" );
|
||||
|
||||
painter->setFont( option.font );
|
||||
|
||||
// draw close icon
|
||||
painter->setPen( TomahawkStyle::GROUP_HEADER );
|
||||
painter->drawText( option.rect.translated( -m_margin / 8, -m_margin / 8 ), text, QTextOption( Qt::AlignBottom | Qt::AlignRight ) );
|
||||
painter->drawText( option.rect.translated( -m_margin / 4, -m_margin / 4 ), text, QTextOption( Qt::AlignBottom | Qt::AlignRight ) );
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
|
Loading…
x
Reference in New Issue
Block a user