Use Color and Colour consistently in the code
This commit is contained in:
@@ -32,7 +32,7 @@ from PyQt6.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import cssCol, readTextFile
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.configlayout import NColorLabel
|
||||
from novelwriter.extensions.modified import NDialog
|
||||
from novelwriter.extensions.versioninfo import VersionInfoWidget
|
||||
from novelwriter.types import QtAlignRightTop, QtDialogClose
|
||||
@@ -68,7 +68,7 @@ class GuiAbout(NDialog):
|
||||
self.nwLicence.setOpenExternalLinks(True)
|
||||
|
||||
# Credits
|
||||
self.lblCredits = NColourLabel(
|
||||
self.lblCredits = NColorLabel(
|
||||
self.tr("Credits"), self, scale=1.6, bold=True
|
||||
)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ from PyQt6.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import SHARED
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.configlayout import NColorLabel
|
||||
from novelwriter.extensions.modified import NDialog
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.types import QtAccepted, QtDialogCancel, QtDialogOk, QtDialogReset, QtUserRole
|
||||
@@ -56,7 +56,7 @@ class GuiDocMerge(NDialog):
|
||||
|
||||
self.headLabel = QLabel(self.tr("Documents to Merge"), self)
|
||||
self.headLabel.setFont(SHARED.theme.guiFontB)
|
||||
self.helpLabel = NColourLabel(
|
||||
self.helpLabel = NColorLabel(
|
||||
self.tr("Drag and drop items to change the order, or uncheck to exclude."),
|
||||
self, color=SHARED.theme.helpText, wrap=True
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ from PyQt6.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import SHARED
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.configlayout import NColorLabel
|
||||
from novelwriter.extensions.modified import NDialog
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.types import QtAccepted, QtDialogCancel, QtDialogOk, QtUserRole
|
||||
@@ -60,7 +60,7 @@ class GuiDocSplit(NDialog):
|
||||
|
||||
self.headLabel = QLabel(self.tr("Document Headings"), self)
|
||||
self.headLabel.setFont(SHARED.theme.guiFontB)
|
||||
self.helpLabel = NColourLabel(
|
||||
self.helpLabel = NColorLabel(
|
||||
self.tr("Select the maximum level to split into files."),
|
||||
self, color=SHARED.theme.helpText, wrap=True
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ from novelwriter.common import compact, describeFont, uniqueCompact
|
||||
from novelwriter.config import DEF_GUI, DEF_ICONS, DEF_SYNTAX, DEF_TREECOL
|
||||
from novelwriter.constants import nwLabels, nwUnicode, trConst
|
||||
from novelwriter.dialogs.quotes import GuiQuoteSelect
|
||||
from novelwriter.extensions.configlayout import NColourLabel, NScrollableForm
|
||||
from novelwriter.extensions.configlayout import NColorLabel, NScrollableForm
|
||||
from novelwriter.extensions.modified import (
|
||||
NComboBox, NDialog, NDoubleSpinBox, NIconToolButton, NSpinBox
|
||||
)
|
||||
@@ -63,9 +63,9 @@ class GuiPreferences(NDialog):
|
||||
self.resize(*CONFIG.prefsWinSize)
|
||||
|
||||
# Title
|
||||
self.titleLabel = NColourLabel(
|
||||
self.titleLabel = NColorLabel(
|
||||
self.tr("Preferences"), self, color=SHARED.theme.helpText,
|
||||
scale=NColourLabel.HEADER_SCALE, indent=4,
|
||||
scale=NColorLabel.HEADER_SCALE, indent=4,
|
||||
)
|
||||
|
||||
# Search Box
|
||||
|
||||
@@ -42,7 +42,7 @@ from novelwriter.common import formatFileFilter, qtLambda, simplified
|
||||
from novelwriter.constants import nwLabels, trConst
|
||||
from novelwriter.core.status import NWStatus, StatusEntry
|
||||
from novelwriter.enum import nwStatusShape
|
||||
from novelwriter.extensions.configlayout import NColourLabel, NFixedPage, NScrollableForm
|
||||
from novelwriter.extensions.configlayout import NColorLabel, NFixedPage, NScrollableForm
|
||||
from novelwriter.extensions.modified import NComboBox, NDialog, NIconToolButton
|
||||
from novelwriter.extensions.pagedsidebar import NPagedSideBar
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
@@ -78,9 +78,9 @@ class GuiProjectSettings(NDialog):
|
||||
)
|
||||
|
||||
# Title
|
||||
self.titleLabel = NColourLabel(
|
||||
self.titleLabel = NColorLabel(
|
||||
self.tr("Project Settings"), self, color=SHARED.theme.helpText,
|
||||
scale=NColourLabel.HEADER_SCALE, indent=4,
|
||||
scale=NColorLabel.HEADER_SCALE, indent=4,
|
||||
)
|
||||
|
||||
# SideBar
|
||||
@@ -339,9 +339,9 @@ class _StatusPage(NFixedPage):
|
||||
self.trSelColor = self.tr("Select Colour")
|
||||
|
||||
# Title
|
||||
self.pageTitle = NColourLabel(
|
||||
self.pageTitle = NColorLabel(
|
||||
pageLabel, self, color=SHARED.theme.helpText,
|
||||
scale=NColourLabel.HEADER_SCALE
|
||||
scale=NColorLabel.HEADER_SCALE
|
||||
)
|
||||
|
||||
# List Box
|
||||
@@ -398,7 +398,7 @@ class _StatusPage(NFixedPage):
|
||||
self.colorButton.setSizePolicy(QtSizeMinimum, QtSizeMinimumExpanding)
|
||||
self.colorButton.setStyleSheet(buttonStyle)
|
||||
self.colorButton.setEnabled(False)
|
||||
self.colorButton.clicked.connect(self._onColourSelect)
|
||||
self.colorButton.clicked.connect(self._onColorSelect)
|
||||
|
||||
def buildMenu(menu: QMenu | None, items: dict[nwStatusShape, str]) -> None:
|
||||
if menu is not None:
|
||||
@@ -494,7 +494,7 @@ class _StatusPage(NFixedPage):
|
||||
return
|
||||
|
||||
@pyqtSlot()
|
||||
def _onColourSelect(self) -> None:
|
||||
def _onColorSelect(self) -> None:
|
||||
"""Open a dialog to select the status icon colour."""
|
||||
if (color := QColorDialog.getColor(self._color, self, self.trSelColor)).isValid():
|
||||
self._color = color
|
||||
@@ -675,9 +675,9 @@ class _ReplacePage(NFixedPage):
|
||||
wCol0 = SHARED.project.options.getInt("GuiProjectSettings", "replaceColW", 130)
|
||||
|
||||
# Title
|
||||
self.pageTitle = NColourLabel(
|
||||
self.pageTitle = NColorLabel(
|
||||
self.tr("Text Auto-Replace for Preview and Build"), self,
|
||||
color=SHARED.theme.helpText, scale=NColourLabel.HEADER_SCALE
|
||||
color=SHARED.theme.helpText, scale=NColorLabel.HEADER_SCALE
|
||||
)
|
||||
|
||||
# List Box
|
||||
|
||||
@@ -37,7 +37,7 @@ from PyQt6.QtWidgets import (
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import formatFileFilter
|
||||
from novelwriter.core.spellcheck import UserDictionary
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.extensions.configlayout import NColorLabel
|
||||
from novelwriter.extensions.modified import NDialog, NIconToolButton
|
||||
from novelwriter.types import QtDialogClose, QtDialogSave
|
||||
|
||||
@@ -65,9 +65,9 @@ class GuiWordList(NDialog):
|
||||
)
|
||||
|
||||
# Header
|
||||
self.headLabel = NColourLabel(
|
||||
self.headLabel = NColorLabel(
|
||||
self.tr("Project Word List"), self, color=SHARED.theme.helpText,
|
||||
scale=NColourLabel.HEADER_SCALE
|
||||
scale=NColorLabel.HEADER_SCALE
|
||||
)
|
||||
|
||||
self.importButton = NIconToolButton(self, iSz, "import", "green")
|
||||
|
||||
Reference in New Issue
Block a user