1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-29 16:50:11 +02:00

* Style cleanup.

This commit is contained in:
Christian Muehlhaeuser
2012-06-26 05:01:18 +02:00
parent cd7c64ac0a
commit 23c2c77869
3 changed files with 19 additions and 14 deletions

View File

@@ -26,8 +26,10 @@
#include <QListView>
#define ROW_HEIGHT 20
#define ICON_PADDING 1
#define ICON_PADDING 2
#define PADDING 2
JobStatusDelegate::JobStatusDelegate( QObject* parent )
: QStyledItemDelegate ( parent )
, m_parentView( qobject_cast< QListView* >( parent ) )
@@ -35,6 +37,7 @@ JobStatusDelegate::JobStatusDelegate( QObject* parent )
Q_ASSERT( m_parentView );
}
JobStatusDelegate::~JobStatusDelegate()
{
@@ -84,9 +87,11 @@ JobStatusDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
mainText = fm.elidedText( mainText, Qt::ElideRight, mainW );
else
to.setWrapMode( QTextOption::WrapAtWordBoundaryOrAnywhere );
painter->drawText( QRect( iconRect.right() + 2*PADDING, PADDING + opt.rect.y(), mainW, opt.rect.height() - 2*PADDING ), mainText, to );
painter->drawText( QRect( iconRect.right() + 4 * PADDING, PADDING + opt.rect.y(), mainW, opt.rect.height() - 2 * PADDING ), mainText, to );
}
QSize
JobStatusDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const
{

View File

@@ -105,7 +105,6 @@ JobStatusView::customDelegateJobInserted( int row, JobStatusItem* item )
if ( !item )
return;
tLog() << Q_FUNC_INFO << "telling item to create delegate";
item->createDelegate( m_view );
tLog() << Q_FUNC_INFO << "item delegate is" << item->customDelegate();
m_view->setItemDelegateForRow( row, item->customDelegate() );

View File

@@ -102,6 +102,7 @@ PlaylistItem::IDValue() const
return m_playlist->createdOn();
}
bool
PlaylistItem::isBeingPlayed() const
{