From 7972fa64939313739fbca3d0234c7e88dfb8e906 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 8 Feb 2021 22:52:37 +1000 Subject: [PATCH] remove 'any flag'; make clicking on flags root do the same thing --- qt/aqt/sidebar.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/qt/aqt/sidebar.py b/qt/aqt/sidebar.py index f26741223..f58c7e746 100644 --- a/qt/aqt/sidebar.py +++ b/qt/aqt/sidebar.py @@ -684,6 +684,7 @@ class SidebarTreeView(QTreeView): def _flags_tree(self, root: SidebarItem) -> None: icon = ColoredIcon(path=":/icons/flag.svg", color=colors.DISABLED) + search = self._filter_func root = self._section_root( root=root, name=TR.BROWSING_SIDEBAR_FLAGS, @@ -691,9 +692,9 @@ class SidebarTreeView(QTreeView): collapse_key=Config.Bool.COLLAPSE_FLAGS, type=SidebarItemType.FLAG_ROOT, ) - type = SidebarItemType.FLAG - search = self._filter_func + root.on_click = search(SearchTerm(flag=SearchTerm.FLAG_ANY)) + type = SidebarItemType.FLAG root.add_simple( TR.ACTIONS_RED_FLAG, icon=icon.with_color(colors.FLAG1_FG), @@ -718,12 +719,6 @@ class SidebarTreeView(QTreeView): type=type, on_click=search(SearchTerm(flag=SearchTerm.FLAG_BLUE)), ) - root.add_simple( - TR.BROWSING_ANY_FLAG, - icon=icon.with_color(colors.TEXT_FG), - type=type, - on_click=search(SearchTerm(flag=SearchTerm.FLAG_ANY)), - ) root.add_simple( TR.BROWSING_NO_FLAG, icon=icon.with_color(colors.DISABLED),