Fix two minor issues (#1843)
This commit is contained in:
@@ -12,7 +12,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
testMac:
|
testMac:
|
||||||
runs-on: macos-latest
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- name: Python Setup
|
- name: Python Setup
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ import logging
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from PyQt5.QtGui import QFont, QIcon, QSyntaxHighlighter, QTextCharFormat, QTextDocument
|
|
||||||
from PyQt5.QtCore import QEvent, Qt, pyqtSignal, pyqtSlot
|
from PyQt5.QtCore import QEvent, Qt, pyqtSignal, pyqtSlot
|
||||||
|
from PyQt5.QtGui import QFont, QIcon, QSyntaxHighlighter, QTextCharFormat, QTextDocument
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QAbstractButton, QAbstractItemView, QDialog, QDialogButtonBox,
|
QAbstractButton, QAbstractItemView, QDialog, QDialogButtonBox, QFontDialog,
|
||||||
QFontDialog, QFrame, QGridLayout, QHBoxLayout, QHeaderView, QLabel,
|
QFrame, QGridLayout, QHBoxLayout, QHeaderView, QLabel, QLineEdit, QMenu,
|
||||||
QLineEdit, QMenu, QPlainTextEdit, QPushButton, QSplitter, QStackedWidget,
|
QPlainTextEdit, QPushButton, QSplitter, QStackedWidget, QTreeWidget,
|
||||||
QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget
|
QTreeWidgetItem, QVBoxLayout, QWidget
|
||||||
)
|
)
|
||||||
|
|
||||||
from novelwriter import CONFIG, SHARED
|
from novelwriter import CONFIG, SHARED
|
||||||
@@ -1060,8 +1060,6 @@ class _FormatTab(NScrollableForm):
|
|||||||
def __init__(self, buildMain: GuiBuildSettings, build: BuildSettings) -> None:
|
def __init__(self, buildMain: GuiBuildSettings, build: BuildSettings) -> None:
|
||||||
super().__init__(parent=buildMain)
|
super().__init__(parent=buildMain)
|
||||||
|
|
||||||
self.buildMain = buildMain
|
|
||||||
|
|
||||||
self._build = build
|
self._build = build
|
||||||
self._unitScale = 1.0
|
self._unitScale = 1.0
|
||||||
|
|
||||||
|
|||||||
@@ -46,3 +46,22 @@ include = ["novelwriter*"]
|
|||||||
|
|
||||||
[project.gui-scripts]
|
[project.gui-scripts]
|
||||||
novelwriter = "novelwriter:main"
|
novelwriter = "novelwriter:main"
|
||||||
|
|
||||||
|
[tool.isort]
|
||||||
|
py_version="310"
|
||||||
|
line_length = 99
|
||||||
|
wrap_length = 79
|
||||||
|
multi_line_output = 5
|
||||||
|
force_grid_wrap = 0
|
||||||
|
lines_between_types = 1
|
||||||
|
forced_separate = ["tests.*"]
|
||||||
|
|
||||||
|
[tool.flake8]
|
||||||
|
max-line-length = 99
|
||||||
|
ignore = ["E133", "E221", "E226", "E228", "E241", "W503", "ANN101", "ANN102", "ANN401"]
|
||||||
|
per-file-ignores = ["tests/*:ANN"]
|
||||||
|
exclude = ["docs/*"]
|
||||||
|
|
||||||
|
[tool.autopep8]
|
||||||
|
max_line_length = 99
|
||||||
|
ignore = ["E133", "E221", "E226", "E228", "E241", "W503"]
|
||||||
|
|||||||
Reference in New Issue
Block a user