~ubuntu-branches/ubuntu/utopic/taskcoach/utopic-proposed

« back to all changes in this revision

Viewing changes to taskcoachlib/widgets/balloontip.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-08-15 14:54:44 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20140815145444-qm2ya2zvy1pyrcl5
Tags: 1.4.0-1ubuntu1
* Merge with Debian; remaining changes:
  - Let the autopkg test depend on language-pack-en.
  - Build-depend on language-pack-en.
* Build using python-wxgtk3.0.
* Don't use /usr/share/pyshared anymore, it's gone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            tx, ty = 0, 0
109
109
        else:
110
110
            tx, ty, tw, th = self._getRect()
111
 
        tx, ty = self._target.ClientToScreen((tx, ty))
112
 
        dpyIndex = wx.Display.GetFromWindow(self._target) or 0
 
111
        tx, ty = self._target.ClientToScreen(wx.Point(tx, ty))
 
112
        dpyIndex = max(0, wx.Display.GetFromPoint(wx.Point(tx, ty)) or 0)
113
113
        rect = wx.Display(dpyIndex).GetClientArea()
114
114
 
115
 
        x = max(0, min(rect.GetRight() - w, int(tx + tw / 2 - w / 2)))
 
115
        x = max(rect.GetLeft(), min(rect.GetRight() - w, int(tx + tw / 2 - w / 2)))
116
116
        y = ty - h
117
117
        direction = 'bottom'
118
118
        if y < rect.GetTop():
170
170
 
171
171
    def AddBalloonTip(self, target, message=None, title=None, bitmap=None, getRect=None, **kwargs):
172
172
        """Schedules a tip. Extra keyword arguments will be passed to L{OnBalloonTipShow} and L{OnBalloonTipClosed}."""
 
173
        for eTarget, eMessage, eTitle, eBitmap, eGetRect, eArgs in self.__tips:
 
174
            if (eTitle, eMessage) == (title, message):
 
175
                return
173
176
        self.__tips.append((target, message, title, bitmap, getRect, kwargs))
174
177
        self.__Try()
175
178