From a45ab2f01720e4fe2f45527c98d50c4bc1b17e34 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:36:44 +0100 Subject: [PATCH] Remove tooltip for non-checkable items --- novelwriter/constants.py | 5 ++--- novelwriter/core/item.py | 10 ++++++++-- novelwriter/gui/projtree.py | 26 -------------------------- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/novelwriter/constants.py b/novelwriter/constants.py index 1477ddbd..be575b5b 100644 --- a/novelwriter/constants.py +++ b/novelwriter/constants.py @@ -275,9 +275,8 @@ class nwLabels: "note": QT_TRANSLATE_NOOP("Constant", "Project Note"), } ACTIVE_NAME = { - "checked": QT_TRANSLATE_NOOP("Constant", "Active"), - "unchecked": QT_TRANSLATE_NOOP("Constant", "Inactive"), - "noncheckable": QT_TRANSLATE_NOOP("Constant", "Not Available"), + "checked": QT_TRANSLATE_NOOP("Constant", "Active"), + "unchecked": QT_TRANSLATE_NOOP("Constant", "Inactive"), } KEY_NAME = { nwKeyWords.TAG_KEY: QT_TRANSLATE_NOOP("Constant", "Tag"), diff --git a/novelwriter/core/item.py b/novelwriter/core/item.py index 2dcc7664..8265b299 100644 --- a/novelwriter/core/item.py +++ b/novelwriter/core/item.py @@ -335,8 +335,14 @@ class NWItem: """Return the relevant active status label and icon for the current item based on its type. """ - key = ("checked" if self._active else "unchecked") if self.isFileType() else "noncheckable" - return trConst(nwLabels.ACTIVE_NAME[key]), SHARED.theme.getIcon(key) + if self.isFileType(): + key = "checked" if self._active else "unchecked" + text = trConst(nwLabels.ACTIVE_NAME[key]) + icon = SHARED.theme.getIcon(key) + else: + text = "" + icon = SHARED.theme.getIcon("noncheckable") + return text, icon ## # Checker Methods diff --git a/novelwriter/gui/projtree.py b/novelwriter/gui/projtree.py index 3827e8a0..1314e958 100644 --- a/novelwriter/gui/projtree.py +++ b/novelwriter/gui/projtree.py @@ -528,10 +528,6 @@ class GuiProjectTree(QTreeView): self.setDragEnabled(True) self.setDragDropMode(QAbstractItemView.DragDropMode.InternalMove) - # Disable built-in auto scroll as it isn't working in some Qt - # releases (see #1561) and instead use our own implementation - # self.setAutoScroll(False) - # Set selection options self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) self.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) @@ -546,13 +542,6 @@ class GuiProjectTree(QTreeView): self.collapsed.connect(self._onNodeCollapsed) self.expanded.connect(self._onNodeExpanded) - # Auto Scroll - # self._scrollMargin = SHARED.theme.baseIconHeight - # self._scrollDirection = 0 - # self._scrollTimer = QTimer(self) - # self._scrollTimer.timeout.connect(self._doAutoScroll) - # self._scrollTimer.setInterval(250) - # Set custom settings self.initSettings() @@ -1160,21 +1149,6 @@ class GuiProjectTree(QTreeView): # self._actHandle = tHandle or None return - ## - # Private Slots - ## - - @pyqtSlot() - def _doAutoScroll(self) -> None: - """Scroll one item up or down based on direction value.""" - # if self._scrollDirection == -1: - # self.scrollToItem(self.itemAbove(self.itemAt(1, 1))) - # elif self._scrollDirection == 1: - # self.scrollToItem(self.itemBelow(self.itemAt(1, self.height() - 1))) - # self._scrollDirection = 0 - # self._scrollTimer.stop() - return - class _UpdatableMenu(QMenu):