Drop the trinary enum
This commit is contained in:
@@ -29,7 +29,6 @@ from PyQt5.QtGui import QColor, QPainter, QPaintEvent
|
||||
from PyQt5.QtWidgets import QAbstractButton, QWidget
|
||||
|
||||
from novelwriter import CONFIG
|
||||
from novelwriter.enum import nwTrinary
|
||||
from novelwriter.types import QtBlack, QtPaintAntiAlias
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -47,14 +46,14 @@ class StatusLED(QAbstractButton):
|
||||
self._postitve = QtBlack
|
||||
self._negative = QtBlack
|
||||
self._color = QtBlack
|
||||
self._state = nwTrinary.NEUTRAL
|
||||
self._state = None
|
||||
self._bPx = CONFIG.pxInt(1)
|
||||
self.setFixedWidth(sW)
|
||||
self.setFixedHeight(sH)
|
||||
return
|
||||
|
||||
@property
|
||||
def state(self) -> nwTrinary:
|
||||
def state(self) -> bool | None:
|
||||
"""The current state of the LED."""
|
||||
return self._state
|
||||
|
||||
@@ -66,11 +65,11 @@ class StatusLED(QAbstractButton):
|
||||
self.setState(self._state)
|
||||
return
|
||||
|
||||
def setState(self, state: nwTrinary) -> None:
|
||||
def setState(self, state: bool | None) -> None:
|
||||
"""Set the colour state."""
|
||||
if state == nwTrinary.POSITIVE:
|
||||
if state is True:
|
||||
self._color = self._postitve
|
||||
elif state == nwTrinary.NEGATIVE:
|
||||
elif state is False:
|
||||
self._color = self._negative
|
||||
else:
|
||||
self._color = self._neutral
|
||||
|
||||
Reference in New Issue
Block a user