First commit
[hidecallerid] / src / idwidget.h
1 #ifndef IDWIDGET_H
2 #define IDWIDGET_H
3
4 #include <QtGui/qpushbutton.h>
5 #include <QtGui/qinputdialog.h>
6 #include <QtGui/qpainter.h>
7 #include "tpsession.h"
8
9 class IdWidget : public QPushButton
10 {
11     Q_OBJECT
12
13 private:
14
15     bool showId;
16     tpSession *tp;
17     QPixmap *pHidden;
18     QPixmap *pShown;
19
20 public:
21     IdWidget(tpSession *tp);
22
23     QSize sizeHint() const
24     {
25         return QSize(200, 75);
26     }
27
28 public slots:
29     void changeState();
30     void setButtonState(bool showId);
31
32 protected:
33     void paintEvent(QPaintEvent *event)
34     {
35         QPainter p(this);
36         p.setBrush(QColor(0, 0, 0, 128));
37         p.setPen(Qt::NoPen);
38         p.drawRoundedRect(rect(), 25, 25);
39         p.end();
40
41         QPushButton::paintEvent(event);
42     }
43 };
44
45 #endif