]> git.sur5r.net Git - minitube/blobdiff - src/playlist/PrettyItemDelegate.h
Imported Debian patch 1.4.1-1
[minitube] / src / playlist / PrettyItemDelegate.h
index 6fc547b894f8a230428dec88929ed506b2f416c8..708256fcd35a8cd9593a07538407c9f3c6091349 100644 (file)
@@ -5,24 +5,29 @@
 #include <QStyledItemDelegate>
 
 class QPainter;
+class QProgressBar;
 
 class PrettyItemDelegate : public QStyledItemDelegate {
 
     Q_OBJECT
 
 public:
-    PrettyItemDelegate( QObject* parent = 0 );
+    PrettyItemDelegate(QObject* parent, bool downloadInfo = false);
     ~PrettyItemDelegate();
 
     QSize sizeHint( const QStyleOptionViewItem&, const QModelIndex& ) const;
     void paint( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
+    QRect downloadButtonRect(QRect line) const;
 
 private:
     void createPlayIcon();
     void paintBody( QPainter*, const QStyleOptionViewItem&, const QModelIndex& ) const;
-    QPointF centerImage( const QPixmap&, const QRectF& ) const;
+    void paintDownloadInfo( QPainter* painter,
+                                        const QStyleOptionViewItem& option,
+                                        const QModelIndex& index ) const;
 
     // active track painting
+    void paintSelectedOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
     void paintActiveOverlay( QPainter *painter, qreal x, qreal y, qreal w, qreal h ) const;
     void paintPlayIcon(QPainter *painter) const;
 
@@ -37,6 +42,9 @@ private:
     QFont boldFont;
     QFont smallerFont;
     QFont smallerBoldFont;
+
+    bool downloadInfo;
+    QProgressBar *progressBar;
 };
 
 #endif