Collect all alignment flags into a new types module

This commit is contained in:
Veronica Berglyd Olsen
2024-04-01 18:27:18 +02:00
parent 468a0e7416
commit c3467d89c2
24 changed files with 195 additions and 171 deletions
+3 -1
View File
@@ -29,6 +29,8 @@ from PyQt5.QtGui import QBrush, QColor, QPaintEvent, QPainter, QPen
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtWidgets import QProgressBar, QSizePolicy, QWidget
from novelwriter.types import QtAlignCenter
class NProgressCircle(QProgressBar):
"""Extension: Circular Progress Widget
@@ -94,7 +96,7 @@ class NProgressCircle(QProgressBar):
painter.setPen(self._cPen)
painter.drawArc(self._cRect, 90*16, -angle)
painter.setPen(self._tColor)
painter.drawText(self._cRect, Qt.AlignCenter, self._text or f"{progress:.1f} %")
painter.drawText(self._cRect, QtAlignCenter, self._text or f"{progress:.1f} %")
return
# END Class NProgressCircle