]> git.sur5r.net Git - minitube/blob - src/thlibrary/thblackbar.h
Imported Upstream version 1.9
[minitube] / src / thlibrary / thblackbar.h
1 #ifndef _THBLACKBAR_H_
2 #define _THBLACKBAR_H_
3
4 #include <QWidget>
5 #include <QAction>
6
7 class THBlackBar : public QWidget {
8     
9     Q_OBJECT
10     
11         public:
12     THBlackBar (QWidget *parent = 0);
13     ~THBlackBar();
14     
15         public:
16     QAction *addAction (QAction *action);
17     QAction *addAction (const QString& text);
18     void setCheckedAction(int index);
19     
20     QSize minimumSizeHint (void) const;
21     
22         protected:
23     void paintEvent (QPaintEvent *event);
24     
25     void mouseMoveEvent (QMouseEvent *event);
26     void mousePressEvent (QMouseEvent *event);
27     void leaveEvent(QEvent *event);
28     
29         private:
30     void drawUnselectedButton ( QPainter *painter,
31                                 const QRect& rect,
32                                 const QAction *action);
33     void drawSelectedButton (   QPainter *painter,
34                                 const QRect& rect,
35                                 const QAction *action);
36     void drawButton (   QPainter *painter,
37                         const QRect& rect,
38                         const QAction *action);
39     void drawButton (   QPainter *painter,
40                         const QRect& rect,
41                         const QLinearGradient& gradient,
42                         const QColor& color,
43                         const QAction *action);
44     
45     QAction *hoveredAction (const QPoint& pos) const;
46     int calculateButtonWidth (void) const;              
47     
48         private:
49     class Private;
50     Private *d;
51 };
52
53 #endif /* !_THBLACKBAR_H_ */
54