From 856e504c260e8a7c82104172d9841966dd3d0144 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:46:01 +0200 Subject: [PATCH] Improve the ternary if in expand state on manuscript dialog --- novelwriter/tools/manuscript.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/novelwriter/tools/manuscript.py b/novelwriter/tools/manuscript.py index d356418e..b0163806 100644 --- a/novelwriter/tools/manuscript.py +++ b/novelwriter/tools/manuscript.py @@ -545,9 +545,7 @@ class _DetailsWidget(QWidget): for i in range(self.listView.topLevelItemCount()): item = self.listView.topLevelItem(i) if isinstance(item, QTreeWidgetItem): - item.setExpanded( - (state[i] if i < count else True) if item.childCount() > 0 else False - ) + item.setExpanded((state[i] if i < count else True) and item.childCount() > 0) return ##