From da69a5e352d5be797a4e50d0133f6c77a8cdc168 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Wed, 16 Jun 2021 14:53:30 +0200 Subject: [PATCH] Add new icons for decks --- qt/aqt/browser/sidebar/tree.py | 16 +++++++++++----- qt/aqt/forms/icons/BUILD.bazel | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/qt/aqt/browser/sidebar/tree.py b/qt/aqt/browser/sidebar/tree.py index 54ea59e4f..cdabf3606 100644 --- a/qt/aqt/browser/sidebar/tree.py +++ b/qt/aqt/browser/sidebar/tree.py @@ -742,7 +742,10 @@ class SidebarTreeView(QTreeView): ########################### def _deck_tree(self, root: SidebarItem) -> None: - icon = ":/icons/deck.svg" + icon = ":/icons/book-outline.svg" + icon_multiple = ":/icons/book-multiple-outline.svg" + icon_current = ":/icons/book-clock-outline.svg" + icon_filtered = ":/icons/book-cog-outline.svg" def render( root: SidebarItem, nodes: Iterable[DeckTreeNode], head: str = "" @@ -760,7 +763,11 @@ class SidebarTreeView(QTreeView): for node in nodes: item = SidebarItem( name=node.name, - icon=icon, + icon=icon_filtered + if node.filtered + else icon_multiple + if node.children + else icon, search_node=SearchNode(deck=head + node.name), on_expanded=toggle_expand(node), expanded=not node.collapsed, @@ -776,14 +783,14 @@ class SidebarTreeView(QTreeView): root = self._section_root( root=root, name=tr.browsing_sidebar_decks(), - icon=icon, + icon=icon_multiple, collapse_key=Config.Bool.COLLAPSE_DECKS, type=SidebarItemType.DECK_ROOT, ) root.search_node = SearchNode(deck="_*") current = root.add_simple( name=tr.browsing_current_deck(), - icon=icon, + icon=icon_current, type=SidebarItemType.DECK_CURRENT, search_node=SearchNode(deck="current"), ) @@ -800,7 +807,6 @@ class SidebarTreeView(QTreeView): notetype_icon = icon template_icon = icon - root = self._section_root( root=root, name=tr.browsing_sidebar_notetypes(), diff --git a/qt/aqt/forms/icons/BUILD.bazel b/qt/aqt/forms/icons/BUILD.bazel index 58e485548..f283889b4 100644 --- a/qt/aqt/forms/icons/BUILD.bazel +++ b/qt/aqt/forms/icons/BUILD.bazel @@ -14,9 +14,10 @@ copy_mdi_icons( "circle-outline.svg", # decks - "book-multiple-outline.svg", "book-outline.svg", + "book-multiple-outline.svg", "book-clock-outline.svg", + "book-cog-outline.svg", # notetypes "newspaper-variant-outline.svg",