[Skencil-commits] r737 - skencil/branches/skencil-0.6/src/Sketch/UI
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Sep 24 12:33:15 CEST 2010
Author: igor_n
Date: 2010-09-24 12:33:14 +0200 (Fri, 24 Sep 2010)
New Revision: 737
Modified:
skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py
Log:
tooltips fixed place behavior is substituted by floating one
Modified: skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py 2010-09-23 12:02:00 UTC (rev 736)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/tooltips.py 2010-09-24 10:33:14 UTC (rev 737)
@@ -70,7 +70,23 @@
self.last_widget = widget_name
self.balloon.withdraw()
self.balloon_label['text'] = text
- x = x - self.balloon_label.winfo_reqwidth() / 2
+
+ width=self.balloon_label.winfo_reqwidth()
+ height=self.balloon_label.winfo_reqheight()
+
+ screenwidth=self.root.winfo_screenwidth()
+ screenheight=self.root.winfo_screenheight()
+
+ x=self.root.winfo_pointerx()+10
+ y=self.root.winfo_pointery()+20
+
+ if screenwidth<(x+width):
+ x=x-width
+
+ if screenheight<(y+height):
+ y=y-height-25
+
+# x = x - self.balloon_label.winfo_reqwidth() / 2
self.balloon.geometry('%+d%+d' % (x, y))
self.balloon.update()
self.balloon.deiconify()
More information about the Skencil-commits
mailing list