summaryrefslogtreecommitdiff
path: root/libopie/oclickablelabel.h
Side-by-side diff
Diffstat (limited to 'libopie/oclickablelabel.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/oclickablelabel.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/libopie/oclickablelabel.h b/libopie/oclickablelabel.h
new file mode 100644
index 0000000..f65c440
--- a/dev/null
+++ b/libopie/oclickablelabel.h
@@ -0,0 +1,30 @@
+#ifndef CLICKABLELABEL
+#define CLICKABLELABEL
+
+#include <qlabel.h>
+
+class OClickableLabel: public QLabel
+{
+ Q_OBJECT
+public:
+ OClickableLabel(QWidget* parent = 0, const char* name = 0,
+ WFlags fl = 0);
+ void setToggleButton(bool t);
+ protected:
+ void mousePressEvent( QMouseEvent *e );
+ void mouseReleaseEvent( QMouseEvent *e );
+ void mouseMoveEvent( QMouseEvent *e );
+ public slots:
+ void setOn(bool on);
+ signals:
+ void clicked();
+ void toggled(bool on);
+ private:
+ bool isToggle;
+ bool isDown;
+ void showState(bool on);
+ bool textInverted;
+ void setInverted(bool on);
+};
+
+#endif