Fix PyQt6 drawText overload in the startup splash
The splash passed two alignment flags to QPainter.drawText, which has no matching PyQt6 overload. Combine them into one int flags value and cast the remaining painted labels for safety. Adds splash and full-page render coverage. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Code
parent
b262b1e664
commit
ffe95020bc
+7
-8
@@ -50,20 +50,19 @@ def _splash_pixmap() -> QPixmap:
|
||||
brand.paint_mark(painter, QRectF(34, 34, 72, 72))
|
||||
painter.setPen(QColor(theme.TEXT))
|
||||
painter.setFont(theme.display_font(26, QFont.Weight.DemiBold))
|
||||
painter.drawText(QRectF(124, 36, 300, 40), Qt.AlignmentFlag.AlignLeft,
|
||||
Qt.AlignmentFlag.AlignVCenter, "BoltClam")
|
||||
left_center = int(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignVCenter)
|
||||
painter.drawText(QRectF(124, 36, 300, 40), left_center, "BoltClam")
|
||||
painter.setPen(QColor(theme.MUTED))
|
||||
painter.setFont(theme.body_font(10.0))
|
||||
painter.drawText(QRectF(126, 76, 300, 24), Qt.AlignmentFlag.AlignLeft,
|
||||
Qt.AlignmentFlag.AlignVCenter, "ClamAV protection, without the noise.")
|
||||
painter.drawText(QRectF(126, 76, 300, 24), left_center,
|
||||
"ClamAV protection, without the noise.")
|
||||
painter.setPen(QColor(theme.TEXT_SOFT))
|
||||
painter.setFont(theme.body_font(10.5))
|
||||
painter.drawText(QRectF(36, 154, 390, 26), Qt.AlignmentFlag.AlignLeft,
|
||||
Qt.AlignmentFlag.AlignVCenter, "Starting protection…")
|
||||
painter.drawText(QRectF(36, 154, 390, 26), left_center, "Starting protection…")
|
||||
painter.setPen(QColor(theme.DIM))
|
||||
painter.setFont(theme.mono_font(8.0))
|
||||
painter.drawText(QRectF(36, 206, 390, 20), Qt.AlignmentFlag.AlignLeft,
|
||||
Qt.AlignmentFlag.AlignVCenter, f"Version {__version__} · {__build_date__}")
|
||||
painter.drawText(QRectF(36, 206, 390, 20), left_center,
|
||||
f"Version {__version__} · {__build_date__}")
|
||||
painter.end()
|
||||
return image
|
||||
|
||||
|
||||
Reference in New Issue
Block a user