]> git.sur5r.net Git - minitube/blob - src/thlibrary/thblackbar.h
Removed THAction class, use plain QAction
[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     
28         private:
29     void drawUnselectedButton ( QPainter *painter,
30                                 const QRect& rect,
31                                 const QAction *action);
32     void drawSelectedButton (   QPainter *painter,
33                                 const QRect& rect,
34                                 const QAction *action);
35     void drawButton (   QPainter *painter,
36                         const QRect& rect,
37                         const QAction *action);
38     void drawButton (   QPainter *painter,
39                         const QRect& rect,
40                         const QLinearGradient& gradient,
41                         const QColor& color,
42                         const QAction *action);
43     
44     QAction *hoveredAction (const QPoint& pos) const;
45     int calculateButtonWidth (void) const;              
46     
47         private:
48     class Private;
49     Private *d;
50 };
51
52 #endif /* !_THBLACKBAR_H_ */
53