Use GUI font for the header and footer in the editor and viewer (#1842)
This commit is contained in:
@@ -39,8 +39,8 @@ from time import time
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from PyQt5.QtCore import (
|
from PyQt5.QtCore import (
|
||||||
pyqtSignal, pyqtSlot, QObject, QPoint, QRegExp, QRegularExpression,
|
QObject, QPoint, QRegExp, QRegularExpression, QRunnable, Qt, QTimer,
|
||||||
QRunnable, Qt, QTimer
|
pyqtSignal, pyqtSlot
|
||||||
)
|
)
|
||||||
from PyQt5.QtGui import (
|
from PyQt5.QtGui import (
|
||||||
QColor, QCursor, QFont, QKeyEvent, QKeySequence, QMouseEvent, QPalette,
|
QColor, QCursor, QFont, QKeyEvent, QKeySequence, QMouseEvent, QPalette,
|
||||||
@@ -65,7 +65,7 @@ from novelwriter.text.counting import standardCounter
|
|||||||
from novelwriter.tools.lipsum import GuiLipsum
|
from novelwriter.tools.lipsum import GuiLipsum
|
||||||
from novelwriter.types import (
|
from novelwriter.types import (
|
||||||
QtAlignCenterTop, QtAlignJustify, QtAlignLeft, QtAlignLeftTop,
|
QtAlignCenterTop, QtAlignJustify, QtAlignLeft, QtAlignLeftTop,
|
||||||
QtAlignRight, QtKeepAnchor, QtModCtrl, QtMouseLeft, QtModeNone, QtModShift,
|
QtAlignRight, QtKeepAnchor, QtModCtrl, QtModeNone, QtModShift, QtMouseLeft,
|
||||||
QtMoveAnchor, QtMoveLeft, QtMoveRight
|
QtMoveAnchor, QtMoveLeft, QtMoveRight
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ class GuiDocEditor(QPlainTextEdit):
|
|||||||
font = QFont()
|
font = QFont()
|
||||||
font.setFamily(CONFIG.textFont)
|
font.setFamily(CONFIG.textFont)
|
||||||
font.setPointSize(CONFIG.textSize)
|
font.setPointSize(CONFIG.textSize)
|
||||||
self.setFont(font)
|
self._qDocument.setDefaultFont(font)
|
||||||
|
|
||||||
# Set default text margins
|
# Set default text margins
|
||||||
# Due to cursor visibility, a part of the margin must be
|
# Due to cursor visibility, a part of the margin must be
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import logging
|
|||||||
|
|
||||||
from enum import Enum
|
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 (
|
from PyQt5.QtGui import (
|
||||||
QCursor, QFont, QMouseEvent, QPalette, QResizeEvent, QTextCursor,
|
QCursor, QFont, QMouseEvent, QPalette, QResizeEvent, QTextCursor,
|
||||||
QTextOption
|
QTextOption
|
||||||
@@ -44,7 +44,7 @@ from novelwriter import CONFIG, SHARED
|
|||||||
from novelwriter.common import cssCol
|
from novelwriter.common import cssCol
|
||||||
from novelwriter.constants import nwHeaders, nwUnicode
|
from novelwriter.constants import nwHeaders, nwUnicode
|
||||||
from novelwriter.core.tohtml import ToHtml
|
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.error import logException
|
||||||
from novelwriter.extensions.eventfilters import WheelEventFilter
|
from novelwriter.extensions.eventfilters import WheelEventFilter
|
||||||
from novelwriter.extensions.modified import NIconToolButton
|
from novelwriter.extensions.modified import NIconToolButton
|
||||||
@@ -146,7 +146,7 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
font = QFont()
|
font = QFont()
|
||||||
font.setFamily(CONFIG.textFont)
|
font.setFamily(CONFIG.textFont)
|
||||||
font.setPointSize(CONFIG.textSize)
|
font.setPointSize(CONFIG.textSize)
|
||||||
self.setFont(font)
|
self.document().setDefaultFont(font)
|
||||||
|
|
||||||
# Set the widget colours to match syntax theme
|
# Set the widget colours to match syntax theme
|
||||||
mainPalette = self.palette()
|
mainPalette = self.palette()
|
||||||
|
|||||||
Reference in New Issue
Block a user