summaryrefslogtreecommitdiff
path: root/libopie/oclickablelabel.cpp
Unidiff
Diffstat (limited to 'libopie/oclickablelabel.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/oclickablelabel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/oclickablelabel.cpp b/libopie/oclickablelabel.cpp
index 43a0524..5768529 100644
--- a/libopie/oclickablelabel.cpp
+++ b/libopie/oclickablelabel.cpp
@@ -4,33 +4,33 @@
4OClickableLabel::OClickableLabel(QWidget* parent, 4OClickableLabel::OClickableLabel(QWidget* parent,
5 const char* name, 5 const char* name,
6 WFlags fl) : 6 WFlags fl) :
7 QLabel(parent,name,fl) 7 QLabel(parent,name,fl)
8{ 8{
9 textInverted=false; 9 textInverted=false;
10 isToggle=false; 10 isToggle=false;
11 isDown=false; 11 isDown=false;
12 showState(false); 12 showState(false);
13 setFrameShadow(Sunken); 13 setFrameShadow(Sunken);
14} 14}
15 15
16void OClickableLabel::setToggleButton(bool t) { 16void OClickableLabel::setToggleButton(bool t) {
17 isToggle=t; 17 isToggle=t;
18} 18}
19 19
20void OClickableLabel::mousePressEvent( QMouseEvent *e ) { 20void OClickableLabel::mousePressEvent( QMouseEvent * /*e*/ ) {
21 if (isToggle && isDown) { 21 if (isToggle && isDown) {
22 showState(false); 22 showState(false);
23 } else { 23 } else {
24 showState(true); 24 showState(true);
25 } 25 }
26} 26}
27 27
28void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { 28void OClickableLabel::mouseReleaseEvent( QMouseEvent *e ) {
29 if (rect().contains(e->pos()) && isToggle) isDown=!isDown; 29 if (rect().contains(e->pos()) && isToggle) isDown=!isDown;
30 30
31 if (isToggle && isDown) { 31 if (isToggle && isDown) {
32 showState(true); 32 showState(true);
33 } else { 33 } else {
34 showState(false); 34 showState(false);
35 } 35 }
36 36