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