Clean up warnings and deprecations in extensions and formats
This commit is contained in:
@@ -28,7 +28,6 @@ import logging
|
||||
from PyQt6.QtGui import QColor, QPainter, QPaintEvent
|
||||
from PyQt6.QtWidgets import QAbstractButton, QWidget
|
||||
|
||||
from novelwriter import CONFIG
|
||||
from novelwriter.enum import nwTrinary
|
||||
from novelwriter.types import QtBlack, QtPaintAntiAlias
|
||||
|
||||
@@ -37,9 +36,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class StatusLED(QAbstractButton):
|
||||
|
||||
__slots__ = (
|
||||
"_neutral", "_postitve", "_negative", "_color", "_state", "_bPx"
|
||||
)
|
||||
__slots__ = ("_neutral", "_postitve", "_negative", "_color", "_state")
|
||||
|
||||
def __init__(self, sW: int, sH: int, parent: QWidget | None = None) -> None:
|
||||
super().__init__(parent=parent)
|
||||
@@ -48,7 +45,6 @@ class StatusLED(QAbstractButton):
|
||||
self._negative = QtBlack
|
||||
self._color = QtBlack
|
||||
self._state = nwTrinary.NEUTRAL
|
||||
self._bPx = CONFIG.pxInt(1)
|
||||
self.setFixedWidth(sW)
|
||||
self.setFixedHeight(sH)
|
||||
return
|
||||
@@ -82,12 +78,9 @@ class StatusLED(QAbstractButton):
|
||||
"""Draw the LED."""
|
||||
painter = QPainter(self)
|
||||
painter.setRenderHint(QtPaintAntiAlias, True)
|
||||
painter.setPen(self.palette().windowText().color())
|
||||
painter.setPen(self.palette().text().color())
|
||||
painter.setBrush(self._color)
|
||||
painter.setOpacity(1.0)
|
||||
painter.drawEllipse(
|
||||
self._bPx, self._bPx,
|
||||
self.width() - 2*self._bPx,
|
||||
self.height() - 2*self._bPx
|
||||
)
|
||||
painter.drawEllipse(1, 1, self.width() - 2, self.height() - 2)
|
||||
painter.end()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user