From abca643c3fa68ae7261ae8a476f423ee2fe8c075 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Thu, 15 Oct 2020 20:45:03 +0100 Subject: [PATCH] Remove doubled "Collapse [category]" in the tag browser context menu when right-clicking on a top-level item. --- src/calibre/gui2/tag_browser/view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index ad82bfcf5a..ba561c1cd6 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -856,7 +856,7 @@ class TagsView(QTreeView): # {{{ if self.isExpanded(index): self.context_menu.addAction(_("Collapse {0}").format(node_name), partial(self.collapse_node, index)) - if parent_index is not None: + if parent_index is not None and parent_index != index: if self.isExpanded(parent_index): # Don't bother to collapse if it isn't expanded self.context_menu.addAction(_("Collapse {0}").format(parent_name),