Merge branch 'theme_fixes' of https://github.com/HeyMyian/novelWriter into theme_fixes
This commit is contained in:
@@ -445,6 +445,7 @@ def fontMatcher(font: QFont) -> QFont:
|
||||
default Qt font matching algorithm doesn't handle well changing
|
||||
application fonts at runtime.
|
||||
"""
|
||||
font.setStyleName(None) # Make sure no font style name is set from config, see #2502
|
||||
info = QFontInfo(font)
|
||||
if (famRequest := font.family()) != (famActual := info.family()):
|
||||
logger.warning("Font mismatch: Requested '%s', but got '%s'", famRequest, famActual)
|
||||
|
||||
@@ -202,7 +202,7 @@ class Config:
|
||||
self.doJustify = False # Justify text
|
||||
self.showTabsNSpaces = False # Show tabs and spaces in editor
|
||||
self.showLineEndings = False # Show line endings in editor
|
||||
self.showMultiSpaces = True # Highlight multiple spaces in the text
|
||||
self.showMultiSpaces = False # Highlight multiple spaces in the text
|
||||
|
||||
self.doReplace = True # Enable auto-replace as you type
|
||||
self.doReplaceSQuote = True # Smart single quotes
|
||||
|
||||
@@ -701,7 +701,7 @@ class GuiPreferences(NDialog):
|
||||
self.showMultiSpaces = NSwitch(self)
|
||||
self.showMultiSpaces.setChecked(CONFIG.showMultiSpaces)
|
||||
self.mainForm.addRow(
|
||||
self.tr("Highlight multiple or trailing spaces"), self.showMultiSpaces,
|
||||
self.tr("Highlight multiple spaces between words"), self.showMultiSpaces,
|
||||
self.tr("Applies to the document editor only.")
|
||||
)
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
|
||||
# Multiple or Trailing Spaces
|
||||
if CONFIG.showMultiSpaces:
|
||||
rxRule = re.compile(r"[ ]{2,}|[ ]*$", re.UNICODE)
|
||||
rxRule = re.compile(r"\s{2,}")
|
||||
hlRule = {
|
||||
0: self._hStyles["mspaces"],
|
||||
}
|
||||
@@ -150,7 +150,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
self._cmnRules.append((rxRule, hlRule))
|
||||
|
||||
# Non-Breaking Spaces
|
||||
rxRule = re.compile(f"[{nwUnicode.U_NBSP}{nwUnicode.U_THNBSP}]+", re.UNICODE)
|
||||
rxRule = re.compile(f"[{nwUnicode.U_NBSP}{nwUnicode.U_THNBSP}]+")
|
||||
hlRule = {
|
||||
0: self._hStyles["nobreak"],
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
self._cmnRules.append((rxRule, hlRule))
|
||||
|
||||
# Alignment Tags
|
||||
rxRule = re.compile(r"(^>{1,2}|<{1,2}$)", re.UNICODE)
|
||||
rxRule = re.compile(r"(^>{1,2}|<{1,2}$)")
|
||||
hlRule = {
|
||||
1: self._hStyles["markup"],
|
||||
}
|
||||
@@ -247,7 +247,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
self._txtRules.append((rxRule, hlRule))
|
||||
|
||||
# Auto-Replace Tags
|
||||
rxRule = re.compile(r"<(\S+?)>", re.UNICODE)
|
||||
rxRule = re.compile(r"<(\S+?)>")
|
||||
hlRule = {
|
||||
0: self._hStyles["replace"],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user