Define header sizes as constants

This commit is contained in:
Veronica Berglyd Olsen committed 2024-05-21 18:02:01 +02:00
1 parent 8ac0440bb3
commit aadad6aa8c
3 files changed
+16 -10

No files matched your search

+9 -9
View File
@@ -36,7 +36,7 @@ from PyQt5.QtGui import (
from novelwriter import CONFIG, SHARED
from novelwriter.common import checkInt
from novelwriter.constants import nwRegEx, nwUnicode
from novelwriter.constants import nwHeaders, nwRegEx, nwUnicode
from novelwriter.core.index import processComment
from novelwriter.enum import nwComment
from novelwriter.types import QRegExUnicode
@@ -95,14 +95,14 @@ class GuiDocHighlighter(QSyntaxHighlighter):
# Create Character Formats
self._addCharFormat("text", SHARED.theme.colText)
self._addCharFormat("header1", SHARED.theme.colHead, "b", 1.8)
self._addCharFormat("header2", SHARED.theme.colHead, "b", 1.6)
self._addCharFormat("header3", SHARED.theme.colHead, "b", 1.4)
self._addCharFormat("header4", SHARED.theme.colHead, "b", 1.2)
self._addCharFormat("head1h", SHARED.theme.colHeadH, "b", 1.8)
self._addCharFormat("head2h", SHARED.theme.colHeadH, "b", 1.6)
self._addCharFormat("head3h", SHARED.theme.colHeadH, "b", 1.4)
self._addCharFormat("head4h", SHARED.theme.colHeadH, "b", 1.2)
self._addCharFormat("header1", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[1])
self._addCharFormat("header2", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[2])
self._addCharFormat("header3", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[3])
self._addCharFormat("header4", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[4])
self._addCharFormat("head1h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[1])
self._addCharFormat("head2h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[2])
self._addCharFormat("head3h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[3])
self._addCharFormat("head4h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[4])
self._addCharFormat("bold", colEmph, "b")
self._addCharFormat("italic", colEmph, "i")
self._addCharFormat("strike", SHARED.theme.colHidden, "s")