statusicon.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:sc-controller 作者: kozec 项目源码 文件源码
def __init__(self, *args, **kwargs):
        StatusIcon.__init__(self, *args, **kwargs)

        try:
            from gi.repository import AppIndicator3 as appindicator

            self._status_active  = appindicator.IndicatorStatus.ACTIVE
            self._status_passive = appindicator.IndicatorStatus.PASSIVE
        except ImportError:
            log.warning("Failed to import AppIndicator3")
            raise NotImplementedError

        category = appindicator.IndicatorCategory.APPLICATION_STATUS
        # Whatever icon is set here will be used as a tooltip icon during the entire time to icon is shown
        self._tray = appindicator.Indicator.new("syncthing-gtk", self._get_icon(), category)
        self._tray.set_menu(self._get_popupmenu())
        self._tray.set_title(self.TRAY_TITLE)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号