예제 #1
0
    def configure(self):
        """
        This method needs to be called to set up the Server with the Qtile manager and
        create the required popup windows.
        """
        if self.horizontal_padding is None:
            self.horizontal_padding = self.font_size / 2
        if self.vertical_padding is None:
            self.vertical_padding = self.font_size / 2

        popup_config = {}
        for opt in Popup.defaults:
            key = opt[0]
            if hasattr(self, key):
                value = getattr(self, key)
                if isinstance(value, (tuple, list)):
                    popup_config[key] = value[1]
                else:
                    popup_config[key] = value

        for win in range(self.max_windows):
            popup = Popup(qtile, **popup_config)
            popup.win.handle_ButtonPress = self._buttonpress(popup)
            popup.replaces_id = None
            self._hidden.append(popup)
            self._positions.append(
                (self.x, self.y + win *
                 (self.height + 2 * self.border_width + self.gap)))

        notifier.register(self._notify, Server.capabilities)
예제 #2
0
    def __init__(self, width=bar.CALCULATED, **config):
        base._TextBox.__init__(self, "", width, **config)
        self.add_defaults(Notify.defaults)
        notifier.register(self.update)
        self.current_id = 0

        self.add_callbacks({
            'Button1': self.clear,
            'Button4': self.prev,
            'Button5': self.next,
        })
예제 #3
0
파일: notify.py 프로젝트: 20after4/qtile
 def __init__(self, width=bar.CALCULATED, **config):
     base._TextBox.__init__(self, "", width, **config)
     self.add_defaults(Notify.defaults)
     notifier.register(self.update)
     self.current_id = 0
예제 #4
0
 def __init__(self, width=bar.CALCULATED, **config):
     base._TextBox.__init__(self, "", width, **config)
     self.add_defaults(Notify.defaults)
     notifier.register(self.update)
     self.current_id = 0