projects
/
drlaunch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean-ups
[drlaunch]
/
src
/
icon.py
diff --git
a/src/icon.py
b/src/icon.py
index
f050463
..
8d2c099
100755
(executable)
--- a/
src/icon.py
+++ b/
src/icon.py
@@
-66,9
+66,6
@@
class Icon(gobject.GObject):
self.clickcount=0
self.clickcount=0
- def __del__(self):
- print "del"
-
def timePressed(self):
""" return how much time a button is pressed """
dt=time.time() - self.lastpress
def timePressed(self):
""" return how much time a button is pressed """
dt=time.time() - self.lastpress
@@
-84,7
+81,6
@@
class Icon(gobject.GObject):
return(config.iconsize+config.iconspace)
def draw(self, cr, x, y, mode):
return(config.iconsize+config.iconspace)
def draw(self, cr, x, y, mode):
- #print "draw", x, y, mode
self.x=x
self.y=y
self.x=x
self.y=y
@@
-141,8
+137,6
@@
class Icon(gobject.GObject):
return(False)
def timerPressed(self):
return(False)
def timerPressed(self):
- #print "timer"
-
if not self.ispressed:
return(False)
if not self.ispressed:
return(False)
@@
-156,7
+150,6
@@
class Icon(gobject.GObject):
return(ret)
def doPress(self):
return(ret)
def doPress(self):
- #print "doPress()"
# Double-time: time for pressed and time for not-pressed
if time.time() - self.lastpress > self.presstime*2:
self.clickcount=0
# Double-time: time for pressed and time for not-pressed
if time.time() - self.lastpress > self.presstime*2:
self.clickcount=0
@@
-164,31
+157,24
@@
class Icon(gobject.GObject):
self.lastpress=time.time()
self.ispressed=True
gobject.timeout_add(20, self.timerPressed)
self.lastpress=time.time()
self.ispressed=True
gobject.timeout_add(20, self.timerPressed)
- #print "doPress() end"
def doRelease(self):
def doRelease(self):
- print "doRelease()"
dt=time.time() - self.lastpress
self.ispressed=False
self.invalidate()
if dt<=self.presstime:
self.clickcount+=1
if self.clickcount==1:
dt=time.time() - self.lastpress
self.ispressed=False
self.invalidate()
if dt<=self.presstime:
self.clickcount+=1
if self.clickcount==1:
- print "click"
self.emit('click')
elif self.clickcount==2:
self.emit('click')
elif self.clickcount==2:
- print "double-click"
self.emit('double-click')
if self.clickcount==3:
self.emit('double-click')
if self.clickcount==3:
- print "tripple-click"
self.emit('tripple-click')
self.clickcount=0
elif dt>self.presstime and dt<2:
self.emit('tripple-click')
self.clickcount=0
elif dt>self.presstime and dt<2:
- print "long-press"
self.emit('long-press')
def doCancel(self):
self.emit('long-press')
def doCancel(self):
- print "doCancel()"
self.ispressed=False
def invalidate(self, window=None):
self.ispressed=False
def invalidate(self, window=None):
@@
-202,7
+188,6
@@
class Icon(gobject.GObject):
w=config.iconsize + config.iconspace
rect=gdk.Rectangle(self.x, self.y, w, w)
w=config.iconsize + config.iconspace
rect=gdk.Rectangle(self.x, self.y, w, w)
- #print "rect", self.x, self.y, w, w
gdk.Window.invalidate_rect(window, rect, True)
gobject.type_register(Icon)
gdk.Window.invalidate_rect(window, rect, True)
gobject.type_register(Icon)