This commit is contained in:
Dimitur Kirov 2006-02-28 10:15:42 +00:00
parent 1f467c0fc3
commit d59678c60f

View file

@ -88,8 +88,8 @@ class BaseTooltip:
self.hide_tooltip() self.hide_tooltip()
def on_size_request(self, widget, requisition): def on_size_request(self, widget, requisition):
half_width = requisition.width / 2 + 1 half_width = requisition.width / 2 + 1
if self.preferred_position[0] < half_width: if self.preferred_position[0] < half_width:
self.preferred_position[0] = 0 self.preferred_position[0] = 0
elif self.preferred_position[0] + requisition.width > \ elif self.preferred_position[0] + requisition.width > \
self.screen.get_width() + half_width: self.screen.get_width() + half_width:
@ -97,7 +97,7 @@ class BaseTooltip:
requisition.width requisition.width
else: else:
self.preferred_position[0] -= half_width self.preferred_position[0] -= half_width
screen.get_height() self.screen.get_height()
if self.preferred_position[1] + requisition.height > \ if self.preferred_position[1] + requisition.height > \
self.screen.get_height(): self.screen.get_height():
# flip tooltip up # flip tooltip up