Skip to content
Browse files

Added corner option, notifications can be display on other corners

  • Loading branch information...
1 parent 719ac97 commit 1083d5ce0f794593026c91bf31451fa5b1b557a8 @NickCis NickCis committed Jan 9, 2011
Showing with 11 additions and 2 deletions.
  1. +11 −2 gtkPopupNotify.py
View
13 gtkPopupNotify.py
@@ -40,6 +40,7 @@ def __init__(self, size_x=300, size_y=100, timeout=5):
"""
Other parameters:
These will take effect for every popup created after the change.
+ `coner` : True if top, true if left
`edge_offset_y` : distance from the bottom of the screen and
the bottom of the stack.
`edge_offset_x` : distance from the right edge of the screen and
@@ -51,6 +52,7 @@ def __init__(self, size_x=300, size_y=100, timeout=5):
`show_timeout : if True, a countdown till destruction will be displayed.
"""
+ self.corner = (False, False)
self.edge_offset_x = 0
self.edge_offset_y = 0
self.max_popups = 5
@@ -145,8 +147,15 @@ def __init__(self, stack, title, message, image):
self.hover = False
self.show_all()
self.x, self.y = self.size_request()
- self.move(gtk.gdk.screen_width() - self.x - stack.edge_offset_x,
- gtk.gdk.screen_height()- self.y - stack._offset - stack.edge_offset_y)
+ if stack.corner[0]:
+ posx = stack.edge_offset_x
+ else:
+ posx = gtk.gdk.screen_width() - self.x - stack.edge_offset_x
+ if stack.corner[1]:
+ posy = stack._offset - stack.edge_offset_y
+ else:
+ posy = gtk.gdk.screen_height()- self.y - stack._offset - stack.edge_offset_y
+ self.move(posx, posy)
self.fade_in_timer = gobject.timeout_add(100, self.fade_in)

0 comments on commit 1083d5c

Please sign in to comment.
Something went wrong with that request. Please try again.