Make some minor improvements to custom widget highlighting

This commit is contained in:
Veronica Berglyd Olsen
2024-02-01 20:34:42 +01:00
parent d504c0a7ec
commit 3b9ef47e0f
5 changed files with 26 additions and 26 deletions
+5 -5
View File
@@ -43,11 +43,11 @@ class NProgressSimple(QProgressBar):
"""Custom painter for the progress bar."""
if (value := self.value()) > 0:
progress = ceil(self.width()*float(value)/self.maximum())
qPaint = QPainter(self)
qPaint.setRenderHint(QPainter.Antialiasing, True)
qPaint.setPen(self.palette().highlight().color())
qPaint.setBrush(self.palette().highlight())
qPaint.drawRect(0, 0, progress, self.height())
painter = QPainter(self)
painter.setRenderHint(QPainter.Antialiasing, True)
painter.setPen(self.palette().highlight().color())
painter.setBrush(self.palette().highlight())
painter.drawRect(0, 0, progress, self.height())
return
# END Class NProgressSimple