示例#1
0
文件: gui.py 项目: Futurile/snapfly
 def __init__(self,destroy,execute):
     """
     @param destroy: callback for destroy function (at this moment (@221) stops inotify)
     @param ExecuteAction: callback for launch_command function
     """
     self.window = None
     self.len = None
     self.menu = None
     self.nbook = None
     self.hide_me = False
     self.updating = False
     self.focus_check = False
     self.mode = None
     self.ExecuteAction = execute
     config = ConfigController()
     self.rounded = int(config.getValue('rounded'))
     self.menu_width = int(config.getValue('menu_width'))
     self.bg_color = config.getValue('bg_color')
     self.border_color = config.getValue('border_color')
     self.showFavorites = True if config.getValue('favorites') == 'true'  else False
     self.terminal = config.getValue('terminal')
     self.mouse_at_scroll = False
     self.tab_width = None
     self.destroy = destroy
     self.tray = None
     if config.getValue('category_click') == 'false':
         self.category_click = False
     else:
         self.category_click = True
     self.create_window()
     self.toggle_hide()
示例#2
0
文件: menu.py 项目: Futurile/snapfly
    def __init__(self, notifier, INOTIFY_SUPPORT):
        self.menu = GtkMenu(self.destroy, self.ExecuteAction)
        self.notifier = notifier

        config = ConfigController()
        self.terminal = config.getValue("terminal")
        self.systray = config.getValue("systray")
        self.hideList = config.getValue("hide_list").split(",")
        self.showFavorites = config.getValue("favorites")

        self.makemenu = snapfly_core.MakeMenu(
            self.ExecuteAction, self.move_on_scroll_event, self.terminal, self.hideList, self.showFavorites
        )

        # self.menu.len = self.makemenu.make(self.menu.nbook)
        self.menu.set_menu(self.makemenu.get_menu())
        self.menu.create_menu(self.makemenu.get_favorites(), snapfly_core.cat_icon)

        self.INOTIFY_SUPPORT = INOTIFY_SUPPORT
        if self.systray == "true":
            self.tray = TrayIcon(self.menu.toggle_hide, self.doQuit)
            self.menu.set_tray_icon(self.tray)