示例#1
0
    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()[0]

        xPos, yPos = position
        self.__window = TransparentWindow(xPos, yPos, width, height)
        self.__context = self.__window.makeCairoContext()
示例#2
0
 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
示例#3
0
    def __setupWindow(self):
        """
        Creates the MessageWindow's underlying TransparentWindow and
        Cairo Context objects, once and for all.
        """

        width = self.__maxSize[0]
        height = self.__maxSize[1]

        xPos = self.__currPos[0]
        yPos = self.__currPos[1]

        # The following are protected to allow subclasses access
        # to them.
        self._wind = TransparentWindow(xPos, yPos, width, height)
        self._context = self._wind.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.
        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()