Fix sorting of library. Add basic search framework.
[dorian] / widgets / translucentbutton.h
1 #ifndef TRANSLUCENTBUTTON_H
2 #define TRANSLUCENTBUTTON_H
3
4 #include <QLabel>
5 #include <QString>
6
7 class QWidget;
8 class QPaintEvent;
9 class QMouseEvent;
10 class QTimer;
11
12 /**
13  * A button that is transparent, but can temporarily made opaque by flashing it.
14  */
15 class TranslucentButton: public QLabel
16 {
17     Q_OBJECT
18
19 public:
20     static const int pixels;
21     explicit TranslucentButton(const QString &iconName, QWidget *parent);
22
23 public slots:
24     void flash(int duration = 3000);
25     void stopFlash();
26
27 signals:
28     void triggered();
29
30 protected:
31     void paintEvent(QPaintEvent *);
32     void mouseReleaseEvent(QMouseEvent *);
33     QString name;
34     bool transparent;
35     QTimer *timer;
36 };
37
38 #endif // TRANSLUCENTBUTTON_H