X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2F.svn%2Ftext-base%2Fpcscustombuttons.py.svn-base;fp=src%2Fui%2F.svn%2Ftext-base%2Fpcscustombuttons.py.svn-base;h=cdbe15fbe1cd4990726e83f0d7c7241219bbc3b1;hb=256d6db84797e58f32185f042154a7c0fc54163e;hp=0000000000000000000000000000000000000000;hpb=7d8224c9f08712280a22af40325d59a19f4fb1e1;p=tablet-suite diff --git a/src/ui/.svn/text-base/pcscustombuttons.py.svn-base b/src/ui/.svn/text-base/pcscustombuttons.py.svn-base new file mode 100644 index 0000000..cdbe15f --- /dev/null +++ b/src/ui/.svn/text-base/pcscustombuttons.py.svn-base @@ -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 + +