Update extensions (#1634)
This commit is contained in:
@@ -59,10 +59,7 @@ class NConfigLayout(QGridLayout):
|
|||||||
def setHelpTextStyle(self, color: QColor | list | tuple,
|
def setHelpTextStyle(self, color: QColor | list | tuple,
|
||||||
fontScale: float = FONT_SCALE) -> None:
|
fontScale: float = FONT_SCALE) -> None:
|
||||||
"""Set the text color for the help text."""
|
"""Set the text color for the help text."""
|
||||||
if isinstance(color, QColor):
|
self._helpCol = color if isinstance(color, QColor) else QColor(*color)
|
||||||
self._helpCol = color
|
|
||||||
else:
|
|
||||||
self._helpCol = QColor(*color)
|
|
||||||
self._fontScale = fontScale
|
self._fontScale = fontScale
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -74,12 +71,6 @@ class NConfigLayout(QGridLayout):
|
|||||||
qHelp.setText(text)
|
qHelp.setText(text)
|
||||||
return
|
return
|
||||||
|
|
||||||
def setLabelText(self, row: int, text: str) -> None:
|
|
||||||
"""Set the text for the main label."""
|
|
||||||
if row in self._itemMap:
|
|
||||||
self._itemMap[row](0).setText(text)
|
|
||||||
return
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Class Methods
|
# Class Methods
|
||||||
##
|
##
|
||||||
@@ -211,10 +202,7 @@ class NHelpLabel(QLabel):
|
|||||||
fontSize: float = FONT_SCALE) -> None:
|
fontSize: float = FONT_SCALE) -> None:
|
||||||
super().__init__(text)
|
super().__init__(text)
|
||||||
|
|
||||||
if isinstance(color, QColor):
|
qCol = color if isinstance(color, QColor) else QColor(*color)
|
||||||
qCol = color
|
|
||||||
else:
|
|
||||||
qCol = QColor(*color)
|
|
||||||
|
|
||||||
lblCol = self.palette()
|
lblCol = self.palette()
|
||||||
lblCol.setColor(QPalette.WindowText, qCol)
|
lblCol.setColor(QPalette.WindowText, qCol)
|
||||||
|
|||||||
@@ -65,10 +65,7 @@ class NPagedSideBar(QToolBar):
|
|||||||
|
|
||||||
def setLabelColor(self, color: list | QColor) -> None:
|
def setLabelColor(self, color: list | QColor) -> None:
|
||||||
"""Set the text color for the labels."""
|
"""Set the text color for the labels."""
|
||||||
if isinstance(color, list):
|
self._labelCol = color if isinstance(color, QColor) else QColor(*color)
|
||||||
self._labelCol = QColor(*color)
|
|
||||||
elif isinstance(color, QColor):
|
|
||||||
self._labelCol = color
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def addSeparator(self) -> None:
|
def addSeparator(self) -> None:
|
||||||
|
|||||||
@@ -41,14 +41,13 @@ class NProgressSimple(QProgressBar):
|
|||||||
|
|
||||||
def paintEvent(self, event: QPaintEvent) -> None:
|
def paintEvent(self, event: QPaintEvent) -> None:
|
||||||
"""Custom painter for the progress bar."""
|
"""Custom painter for the progress bar."""
|
||||||
if self.value() == 0:
|
if (value := self.value()) > 0:
|
||||||
return
|
progress = ceil(self.width()*float(value)/self.maximum())
|
||||||
progress = ceil(self.width()*float(self.value())/self.maximum())
|
qPaint = QPainter(self)
|
||||||
qPaint = QPainter(self)
|
qPaint.setRenderHint(QPainter.Antialiasing, True)
|
||||||
qPaint.setRenderHint(QPainter.Antialiasing, True)
|
qPaint.setPen(self.palette().highlight().color())
|
||||||
qPaint.setPen(self.palette().highlight().color())
|
qPaint.setBrush(self.palette().highlight())
|
||||||
qPaint.setBrush(self.palette().highlight())
|
qPaint.drawRect(0, 0, progress, self.height())
|
||||||
qPaint.drawRect(0, 0, progress, self.height())
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# END Class NProgressSimple
|
# END Class NProgressSimple
|
||||||
|
|||||||
@@ -134,10 +134,10 @@ class NSwitch(QAbstractButton):
|
|||||||
qPaint.setBrush(thumbBrush)
|
qPaint.setBrush(thumbBrush)
|
||||||
qPaint.drawEllipse(self._offset - self._rR, self._rB, self._rH, self._rH)
|
qPaint.drawEllipse(self._offset - self._rR, self._rB, self._rH, self._rH)
|
||||||
|
|
||||||
theFont = qPaint.font()
|
font = qPaint.font()
|
||||||
theFont.setPixelSize(self._xT)
|
font.setPixelSize(self._xT)
|
||||||
qPaint.setPen(textColor)
|
qPaint.setPen(textColor)
|
||||||
qPaint.setFont(theFont)
|
qPaint.setFont(font)
|
||||||
qPaint.drawText(
|
qPaint.drawText(
|
||||||
QRectF(self._offset - self._rR, self._rB, self._rH, self._rH),
|
QRectF(self._offset - self._rR, self._rB, self._rH, self._rH),
|
||||||
Qt.AlignCenter, thumbText
|
Qt.AlignCenter, thumbText
|
||||||
|
|||||||
@@ -106,11 +106,6 @@ class NSwitchBox(QScrollArea):
|
|||||||
self._bumpIndex()
|
self._bumpIndex()
|
||||||
return
|
return
|
||||||
|
|
||||||
def setInnerContentsMargins(self, left: int, top: int, right: int, bottom: int) -> None:
|
|
||||||
"""Set the contents margins of the inner layout."""
|
|
||||||
self._content.setContentsMargins(left, top, right, bottom)
|
|
||||||
return
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Internal Functions
|
# Internal Functions
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ class GuiManuscriptBuild(QDialog):
|
|||||||
self._build.setLastBuildName(bName)
|
self._build.setLastBuildName(bName)
|
||||||
self._build.setLastFormat(bFormat)
|
self._build.setLastFormat(bFormat)
|
||||||
|
|
||||||
QTimer.singleShot(1000, self._resetProgress)
|
QTimer.singleShot(3000, self._resetProgress)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
@@ -441,6 +441,7 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockRnd):
|
|||||||
assert nwGUI.docEditor.isEmpty
|
assert nwGUI.docEditor.isEmpty
|
||||||
|
|
||||||
# qtbot.stop()
|
# qtbot.stop()
|
||||||
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
# Check Menu Entries
|
# Check Menu Entries
|
||||||
nwGUI.mainMenu.aInsENDash.activate(QAction.Trigger)
|
nwGUI.mainMenu.aInsENDash.activate(QAction.Trigger)
|
||||||
|
|||||||
Reference in New Issue
Block a user