~ubuntu-branches/ubuntu/saucy/minitube/saucy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef PLAYLISTVIEW_H
#define PLAYLISTVIEW_H

#include <QtGui>

class PlaylistView : public QListView {

    Q_OBJECT

public:
    PlaylistView(QWidget *parent = 0);
    void setClickableAuthors(bool enabled) { clickableAuthors = enabled; }

protected:
    void leaveEvent(QEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

signals:
    void authorPushed(QModelIndex index);

private slots:
    void itemEntered(const QModelIndex &index);

private:
    bool isHoveringAuthor(QMouseEvent *event);
    bool isShowMoreItem(const QModelIndex &index);
    bool isHoveringThumbnail(QMouseEvent *event);

    bool clickableAuthors;

};

#endif // PLAYLISTVIEW_H