mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Place Wrench and Remove button next to eachother
This commit is contained in:
@@ -250,19 +250,14 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
{
|
{
|
||||||
const QString btnText = tr( "Remove" );
|
const QString btnText = tr( "Remove" );
|
||||||
const int btnWidth = installMetrics.width( btnText ) + 2*PADDING;
|
const int btnWidth = installMetrics.width( btnText ) + 2*PADDING;
|
||||||
QRect btnRect;
|
|
||||||
|
QRect btnRect = QRect( opt.rect.right() - 3 * PADDING - btnWidth,
|
||||||
|
center - installMetrics.height() / 2 - PADDING,
|
||||||
|
btnWidth, installMetrics.height() + 2*PADDING );
|
||||||
|
|
||||||
if ( hasConfigWrench )
|
if ( hasConfigWrench )
|
||||||
btnRect = QRect( opt.rect.right() - PADDING - btnWidth, opt.rect.bottom() - installMetrics.height() - 3*PADDING, btnWidth, installMetrics.height() + 2*PADDING );
|
btnRect.moveLeft( btnRect.left() - WRENCH_SIZE );
|
||||||
else
|
|
||||||
btnRect = QRect( opt.rect.right() - PADDING - btnWidth, center - ( installMetrics.height() + 4 ) / 2, btnWidth, installMetrics.height() + 2*PADDING );
|
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
|
||||||
btnRect.adjust( -4, 0, 4, 0 );
|
|
||||||
|
|
||||||
if ( hasConfigWrench )
|
|
||||||
btnRect.moveTop( btnRect.top() + 2 );
|
|
||||||
#endif
|
|
||||||
leftEdge = btnRect.left();
|
leftEdge = btnRect.left();
|
||||||
m_cachedButtonRects[ index ] = btnRect;
|
m_cachedButtonRects[ index ] = btnRect;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user