X-Git-Url: http://git.maemo.org/git/?p=tablet-suite;a=blobdiff_plain;f=src%2Fui%2Fpcscustombuttons.py;fp=src%2Fui%2Fpcscustombuttons.py;h=cdbe15fbe1cd4990726e83f0d7c7241219bbc3b1;hp=0000000000000000000000000000000000000000;hb=256d6db84797e58f32185f042154a7c0fc54163e;hpb=7d8224c9f08712280a22af40325d59a19f4fb1e1 diff --git a/src/ui/pcscustombuttons.py b/src/ui/pcscustombuttons.py new file mode 100644 index 0000000..cdbe15f --- /dev/null +++ b/src/ui/pcscustombuttons.py @@ -0,0 +1,35 @@ +# Authors: Amaury Medeiros and Paulo Ouriques +# Software License: GPL + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class PcsCustomButton(QLabel): + def __init__(self, image, pressedImage, text = "", parent = None): + super(QLabel, self).__init__(parent) + + self.panel = QLabel() + self.layout = QHBoxLayout() + self.text = QLabel(text) + self.defaultPixmap = QPixmap(image) + self.pressedPixmap = QPixmap(pressedImage) + self.panel.setPixmap(self.defaultPixmap) + self.panel.setGeometry(self.defaultPixmap.rect()) + self.layout.addWidget(self.panel) + if(text <> ""): + self.layout.addWidget(self.text) + self.setLayout(self.layout) + + + def mouseReleaseEvent(self,event): + self.panel.setPixmap(self.defaultPixmap) + self.emit(SIGNAL("clicked()")) + + def mousePressEvent(self, event): + self.panel.setPixmap(self.pressedPixmap) + + def setTextVisible(self, flag): + if flag: + pass + +