# self.igw.do_realize()
# self.igw.setSize(config.getSize())
- hbox=gtk.HBox()
- self.add(hbox)
+ self.pa=hildon.PannableArea()
+ self.add(self.pa)
+ self.pa.set_property('mov-mode', hildon.MOVEMENT_MODE_HORIZ)
- # Add the icongrid
- hbox.add(self.igw)
+ hbox=gtk.HBox()
+ self.pa.add_with_viewport(hbox)
# Now go for the right side
al=gtk.Alignment(yscale=0)
self.buttonRequireLongpress=but
vbox.add(but)
- #self.igw.connect('long-press', self.slotLongpress)
+ but=hildon.CheckButton(
+ gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT)
+ but.set_label("Animate rotation")
+ self.buttonAnimateRotation=but
+ vbox.add(but)
+
+ # Add the icongrid
+ al=gtk.Alignment(xalign=0, xscale=0)
+ al.add(self.igw)
+ al.set_padding(0, 0, 20, 0)
+ hbox.add(al)
+
+ self.igw.connect('long-press', self.slotLongpress)
self.igw.connect('click', self.slotLongpress)
self.ignore_toggle=False
self.setSize(self.config.getSize())
self.setIndiv(self.config.getIndiv())
self.setLongpress(self.config.getLongpress())
+ self.setAnimate(self.config.getAnimate())
def slotLongpress(self, sender, icon):
self.doConfig(icon)
if indiv:
for i in self.butsSizeY:
i.set_sensitive(True)
+ for i in self.butsSizeX:
+ i.set_sensitive(True)
+
else:
for i in self.butsSizeY:
i.set_sensitive(False)
+
+ cnt=0
+ for i in self.butsSizeX:
+ cnt+=1
+ if cnt>4:
+ i.set_sensitive(False)
+
sz=self.getSize()
szx=sz[0]
if szx>4:
def setLongpress(self, lp):
self.buttonRequireLongpress.set_active(lp)
+ def setAnimate(self, ar):
+ self.buttonAnimateRotation.set_active(ar)
+
def doConfig(self, icon):
aps=apps.scan()
r=dialog.run()
if r==gtk.RESPONSE_OK:
- cur=selector.get_current_text()
- if cur=='None':
+ idx2=selector.get_active(0)
+ if idx2<1:
app=None
else:
+ cur=lst[idx2-1]
for i in aps:
if aps[i]['name']==cur:
app=aps[i]
indiv=self.buttonRotateIndividually.get_active()
lp=self.buttonRequireLongpress.get_active()
+ ar=self.buttonAnimateRotation.get_active()
ret={
'size': sz,
'apps': wapps,
'indiv': indiv,
'longpress': lp,
+ 'animate': ar,
}
return(ret)