remove 'any flag'; make clicking on flags root do the same thing

This commit is contained in:
Damien Elmes 2021-02-08 22:52:37 +10:00
parent 202cf38446
commit 7972fa6493

View File

@ -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),