Skip to content

Commit

Permalink
Use GUI font for the header and footer in the editor and viewer (#1842)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo committed May 1, 2024
1 parent 7c9c5a9 commit dd3c8df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions novelwriter/gui/doceditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
from typing import TYPE_CHECKING

from PyQt5.QtCore import (
pyqtSignal, pyqtSlot, QObject, QPoint, QRegExp, QRegularExpression,
QRunnable, Qt, QTimer
QObject, QPoint, QRegExp, QRegularExpression, QRunnable, Qt, QTimer,
pyqtSignal, pyqtSlot
)
from PyQt5.QtGui import (
QColor, QCursor, QFont, QKeyEvent, QKeySequence, QMouseEvent, QPalette,
Expand All @@ -65,7 +65,7 @@
from novelwriter.tools.lipsum import GuiLipsum
from novelwriter.types import (
QtAlignCenterTop, QtAlignJustify, QtAlignLeft, QtAlignLeftTop,
QtAlignRight, QtKeepAnchor, QtModCtrl, QtMouseLeft, QtModeNone, QtModShift,
QtAlignRight, QtKeepAnchor, QtModCtrl, QtModeNone, QtModShift, QtMouseLeft,
QtMoveAnchor, QtMoveLeft, QtMoveRight
)

Expand Down Expand Up @@ -334,7 +334,7 @@ def initEditor(self) -> None:
font = QFont()
font.setFamily(CONFIG.textFont)
font.setPointSize(CONFIG.textSize)
self.setFont(font)
self._qDocument.setDefaultFont(font)

# Set default text margins
# Due to cursor visibility, a part of the margin must be
Expand Down
6 changes: 3 additions & 3 deletions novelwriter/gui/docviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from enum import Enum

from PyQt5.QtCore import pyqtSignal, pyqtSlot, QPoint, Qt, QUrl
from PyQt5.QtCore import QPoint, Qt, QUrl, pyqtSignal, pyqtSlot
from PyQt5.QtGui import (
QCursor, QFont, QMouseEvent, QPalette, QResizeEvent, QTextCursor,
QTextOption
Expand All @@ -44,7 +44,7 @@
from novelwriter.common import cssCol
from novelwriter.constants import nwHeaders, nwUnicode
from novelwriter.core.tohtml import ToHtml
from novelwriter.enum import nwItemType, nwDocAction, nwDocMode
from novelwriter.enum import nwDocAction, nwDocMode, nwItemType
from novelwriter.error import logException
from novelwriter.extensions.eventfilters import WheelEventFilter
from novelwriter.extensions.modified import NIconToolButton
Expand Down Expand Up @@ -146,7 +146,7 @@ def initViewer(self) -> None:
font = QFont()
font.setFamily(CONFIG.textFont)
font.setPointSize(CONFIG.textSize)
self.setFont(font)
self.document().setDefaultFont(font)

# Set the widget colours to match syntax theme
mainPalette = self.palette()
Expand Down

0 comments on commit dd3c8df

Please sign in to comment.