diff --git a/src/calibre/gui2/tweak_book/char_select.py b/src/calibre/gui2/tweak_book/char_select.py index 227561b872..c8550337d6 100644 --- a/src/calibre/gui2/tweak_book/char_select.py +++ b/src/calibre/gui2/tweak_book/char_select.py @@ -439,11 +439,17 @@ class CategoryView(QTreeView): if hasattr(pi, 'set_no_activate_on_click'): pi.set_no_activate_on_click(self) self.initialized = False + self.setExpandsOnDoubleClick(False) def item_activated(self, index): ans = self._model.get_range(index) if ans is not None: self.category_selected.emit(*ans) + else: + if self.isExpanded(index): + self.collapse(index) + else: + self.expand(index) def initialize(self): if not self.initialized: