~ubicast/touchwizard/1.2-stable

« back to all changes in this revision

Viewing changes to touchwizard/icon.py

  • Committer: Stephane Diemer
  • Date: 2010-12-06 18:12:14 UTC
  • Revision ID: stephane.diemer@ubicast.eu-20101206181214-nuc3ouvykk2krsoq
Remove simple click from touchwizard icons ;

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
            logger.error('in icon: Icon file %s does not exist.', picture_path)
205
205
            self.picture = candies2.ClassicButton('no icon')
206
206
 
207
 
        candies2.SimpleClick(self.picture)
208
207
        self.picture.set_parent(self)
209
208
        self.picture.set_reactive(True)
210
 
        self.picture.connect('simple-click-event', lambda src: self.action())
 
209
        self.picture.connect('button-release-event', self.action)
211
210
 
212
211
        if not isinstance(self.picture, candies2.ClassicButton):
213
212
            if self.picture_on is None and self.picture_off is not None:
294
293
        #self.back.allocate(clutter.ActorBox(0, 0, icon_width, icon_height), flags)
295
294
        clutter.Actor.do_allocate(self, box, flags)
296
295
 
297
 
    def action(self, event=None):
 
296
    def action(self, source=None, event=None):
298
297
        what_to_do = self.ACTION_ANIMATE_AND_OPERATE
299
298
        new_state = None
300
 
        if event is not None and event.content is not None:
301
 
            what_to_do = event.content
302
 
            if isinstance(event.content, dict):
303
 
                what_to_do = event.content['action']
304
 
                new_state = event.content['state']
305
299
        actions = (self.ACTION_ANIMATE_AND_OPERATE, self.ACTION_ANIMATE_ONLY)
306
300
        if self.is_locked:
307
301
            actions = (self.ACTION_ANIMATE_ONLY, )