diff --git a/resources.qrc b/resources.qrc index 1ab7b9cd8..094a99153 100644 --- a/resources.qrc +++ b/resources.qrc @@ -152,5 +152,6 @@ data/images/subscribe-off.png data/images/add-contact.png data/images/account-none.png + data/images/green-dot.png diff --git a/src/sourcetree/SourceDelegate.cpp b/src/sourcetree/SourceDelegate.cpp index 17e2717ea..4a9fbdb45 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -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 { diff --git a/src/sourcetree/SourceDelegate.h b/src/sourcetree/SourceDelegate.h index 099839137..d58829f0e 100644 --- a/src/sourcetree/SourceDelegate.h +++ b/src/sourcetree/SourceDelegate.h @@ -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;