def __setupWindow( self, height=None, position=None ): # Use the maximum width that we can, i.e., the desktop width. if height is not None: self.__height = height if position is not None: self.__xPos, self.__yPos = position self.__width, _ = graphics.getDesktopSize() left, top = graphics.getDesktopOffset() try: self.__window = TransparentWindow(self.__xPos + left, self.__yPos, self.__width, self.__height ) except Exception, e: print e
def __init__(self, height, position): """ Creates the underlying TransparentWindow and Cairo context. Position and height should be in pixels. """ # Use the maximum width that we can, i.e., the desktop width. width, _ = graphics.getDesktopSize() left, top = graphics.getDesktopOffset() xPos, yPos = position self.__window = TransparentWindow(xPos + left, yPos, width, height) self.__context = self.__window.makeCairoContext()
def __init__( self, height, position ): """ Creates the underlying TransparentWindow and Cairo context. Position and height should be in pixels. """ # Use the maximum width that we can, i.e., the desktop width. width, _ = graphics.getDesktopSize() left, top = graphics.getDesktopOffset() xPos, yPos = position self.__window = TransparentWindow(xPos + left, yPos, width, height ) self.__context = self.__window.makeCairoContext()
def __position(self): """ Centers the message window horizontally using the current size. """ desksize = graphics.getDesktopSize() left, top = graphics.getDesktopOffset() xPos = ((desksize[0] - self.getSize()[0]) / 2) + left # Set the height based on the "maximum" height, so that the # message always appears at the same vertical offset from the # top of the screen. yPos = (desksize[1] - self.getMaxSize()[1]) / 2 self.setPos(xPos, yPos)
def __position( self ): """ Centers the message window horizontally using the current size. """ desksize = graphics.getDesktopSize() left, top = graphics.getDesktopOffset() xPos = ((desksize[0] - self.getSize()[0]) / 2) + left # Set the height based on the "maximum" height, so that the # message always appears at the same vertical offset from the # top of the screen. yPos = ( desksize[1] - self.getMaxSize()[1] ) / 2 self.setPos( xPos, yPos )
def __setupWindow(self, height=None, position=None): # Use the maximum width that we can, i.e., the desktop width. if height is not None: self.__height = height if position is not None: self.__xPos, self.__yPos = position self.__width, _ = graphics.getDesktopSize() left, top = graphics.getDesktopOffset() try: self.__window = TransparentWindow(self.__xPos + left, self.__yPos, self.__width, self.__height) except Exception as e: logging.error(e) self.__context = self.__window.makeCairoContext() self.__is_visible = True
def __init__(self, height, position): """ Creates the underlying TransparentWindow and Cairo context. Position and height should be in pixels. """ # Use the maximum width that we can, i.e., the desktop width. desk_width, desk_height = graphics.getDesktopSize() desk_left, desk_top = graphics.getDesktopOffset() xPos, yPos = position if yPos + height > desk_height: pass self.__window = TransparentWindow( xPos + desk_left, yPos + desk_top, desk_width, desk_height - desk_top - yPos) self.__context = self.__window.makeCairoContext() self.__is_visible = False self.__animatingShow = False self.__animatingHide = False self.__timeSinceDismissal = 0 self.__evtManager = EventManager.get()