mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 09:34:53 +02:00
Add greenDot indicator for collaborative playlist
This commit is contained in:
@@ -152,5 +152,6 @@
|
||||
<file>data/images/subscribe-off.png</file>
|
||||
<file>data/images/add-contact.png</file>
|
||||
<file>data/images/account-none.png</file>
|
||||
<file>data/images/green-dot.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@@ -40,7 +40,6 @@
|
||||
|
||||
#define TREEVIEW_INDENT_ADD 12
|
||||
|
||||
|
||||
SourceDelegate::SourceDelegate( QAbstractItemView* parent )
|
||||
: QStyledItemDelegate( parent )
|
||||
, m_parent( parent )
|
||||
@@ -72,6 +71,7 @@ SourceDelegate::SourceDelegate( QAbstractItemView* parent )
|
||||
m_realtimeUnlocked.load( RESPATH "images/open-padlock.png" );
|
||||
m_nowPlayingSpeaker.load( RESPATH "images/now-playing-speaker.png" );
|
||||
m_nowPlayingSpeakerDark.load( RESPATH "images/now-playing-speaker-dark.png" );
|
||||
m_collaborativeOn.load( RESPATH "images/green-dot.png" );
|
||||
}
|
||||
|
||||
|
||||
@@ -569,6 +569,13 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
const QRect subRect( o.rect.right() - padding - imgWidth, o.rect.top() + padding, imgWidth, imgWidth );
|
||||
painter->drawPixmap( subRect, icon );
|
||||
}
|
||||
if ( plItem->collaborative() )
|
||||
{
|
||||
const int imgWidth = m_collaborativeOn.size().width();
|
||||
const QRect subRect( o.rect.left(), o.rect.top(), imgWidth, imgWidth );
|
||||
painter->drawPixmap( subRect, m_collaborativeOn );
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
QStyledItemDelegate::paint( painter, o, index );
|
||||
@@ -579,7 +586,6 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SourceDelegate::updateEditorGeometry( QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||
{
|
||||
|
@@ -61,7 +61,6 @@ private slots:
|
||||
|
||||
private:
|
||||
void paintDecorations( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||
|
||||
void paintCollection( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||
void paintCategory( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||
void paintGroup( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||
@@ -73,9 +72,8 @@ private:
|
||||
QMimeData *m_dropMimeData;
|
||||
mutable SourceTreeItem::DropType m_hoveredDropType; // Hack to keep easily track of the current highlighted DropType in paint()
|
||||
QMap< QModelIndex, AnimationHelper* > m_expandedMap;
|
||||
QPixmap m_headphonesOn, m_headphonesOff, m_realtimeLocked, m_realtimeUnlocked, m_nowPlayingSpeaker, m_nowPlayingSpeakerDark;
|
||||
QPixmap m_headphonesOn, m_headphonesOff, m_realtimeLocked, m_realtimeUnlocked, m_nowPlayingSpeaker, m_nowPlayingSpeakerDark, m_collaborativeOn;
|
||||
qint64 m_lastClicked;
|
||||
|
||||
QMap< int, SourceTreeItem::DropType > m_dropTypeMap;
|
||||
QMap< int, QString > m_dropTypeTextMap;
|
||||
QMap< int, QPixmap > m_dropTypeImageMap;
|
||||
|
Reference in New Issue
Block a user