Restore project item emphasis

This commit is contained in:
Veronica Berglyd Olsen
2024-11-21 01:33:09 +01:00
parent d55f53be0a
commit 7ed619cf2e
4 changed files with 20 additions and 6 deletions
+11 -2
View File
@@ -27,9 +27,9 @@ import logging
from typing import TYPE_CHECKING, Any
from PyQt5.QtGui import QIcon
from PyQt5.QtGui import QFont, QIcon
from novelwriter import SHARED
from novelwriter import CONFIG, SHARED
from novelwriter.common import (
checkInt, isHandle, isItemClass, isItemLayout, isItemType, simplified,
yesNo
@@ -325,6 +325,15 @@ class NWItem:
"""Get the main item icon."""
return SHARED.theme.getItemIcon(self._type, self._class, self._layout, self._heading)
def getMainFont(self) -> QFont:
"""Get the main item icon."""
if CONFIG.emphLabels and self._layout == nwItemLayout.DOCUMENT:
if self._heading == "H1":
return SHARED.theme.guiFontBU
elif self._heading == "H2":
return SHARED.theme.guiFontB
return SHARED.theme.guiFont
def getImportStatus(self) -> tuple[str, QIcon]:
"""Return the relevant importance or status label and icon for
the current item based on its class.