Skip to content
Snippets Groups Projects
Commit 93fd3a69 authored by Tim Huppertz's avatar Tim Huppertz
Browse files

Rearranged buttons.

parent 24b65507
No related branches found
No related tags found
No related merge requests found
......@@ -195,26 +195,35 @@ class Deskoala(plasmascript.Applet):
def init(self):
self.setHasConfigurationInterface(True)
self.resize(280, 240)
self.setAspectRatioMode(Plasma.Square)
self.resize(320, 260)
# self.setAspectRatioMode(Plasma.Square)
self.layout = QGraphicsLinearLayout(Qt.Horizontal,self.applet)
self.label = Plasma.Label(self.applet)
self.layout.addItem(self.label)
self.show_mood()
self.buttons = QGraphicsLinearLayout(Qt.Vertical, self.layout)
self.buttons = []
for b in [("feed", self.feed), ("turn", self.turn), ("excercise", self.excercise), ("brush", self.brush), ("soap", self.soap), ("medicine", self.medicine), ("bonbon", self.bonbon), ("hug", self.hug), ("walk", self.walk), ("sleep", self.sleep)]:
button = Plasma.PushButton(self.applet)
button.setImage(self.package().filePath('images', 'button_' + b[0] + '.gif'))
self.connect(button, SIGNAL("clicked()"), b[1])
self.buttons.addItem(button)
for g in [
[("feed", self.feed), ("turn", self.turn), ("excercise", self.excercise), ("brush", self.brush), ("soap", self.soap)],
[("medicine", self.medicine), ("bonbon", self.bonbon), ("hug", self.hug), ("walk", self.walk), ("sleep", self.sleep)]
]:
buttons = QGraphicsLinearLayout(Qt.Vertical, self.layout)
for b in g:
button = Plasma.PushButton(self.applet)
button.setImage(self.package().filePath('images', 'button_' + b[0] + '.gif'))
self.connect(button, SIGNAL("clicked()"), b[1])
buttons.addItem(button)
self.buttons.append(buttons)
self.layout.addItem(buttons)
self.layout.addItem(self.buttons)
self.startTimer(5000)
def createConfigurationInterface(self,parent):
self.koalaConfig = KoalaConfig(self)
page = parent.addPage(self.koalaConfig,"")
self.connect(parent, SIGNAL("okClicked()"), self.configAccepted)
self.connect(parent, SIGNAL("cancelClicked()"), self.configDenied)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment