This commit is contained in:
Your Name
2026-08-18 14:08:38 +08:00
parent 8b9df1154c
commit bc1228a310
77 changed files with 10763 additions and 1181 deletions
+27 -2
View File
@@ -31,6 +31,8 @@ class _ScreenshotDiagnosisDialog(QWidget):
consultations_module.DiagnosisDialog = _ScreenshotDiagnosisDialog
DENSITY_SIZES = ((1366, 768), (1710, 920))
def _row(identifier: int, variant: int) -> dict[str, Any]:
common: dict[str, Any] = {
@@ -335,7 +337,7 @@ def _save_with_payment_qr(
return path
def render() -> list[Path]:
def _application() -> QApplication:
app = QApplication.instance() or QApplication([])
# The offscreen Windows plugin does not enumerate system fonts. Register
# the same CJK face used by the production QSS when it is available.
@@ -345,12 +347,35 @@ def render() -> list[Path]:
families = QFontDatabase.applicationFontFamilies(font_id)
if families:
app.setFont(QFont(families[0], 9))
return app
def render_density() -> list[Path]:
"""Render only the two desktop-density acceptance sizes."""
app = _application()
root = Path(__file__).resolve().parents[1]
output = root / "artifacts" / "diagnosis_visual"
output.mkdir(parents=True, exist_ok=True)
paths: list[Path] = []
repository = ScreenshotRepository()
for width, height in ((1024, 640), (1440, 900)):
for width, height in DENSITY_SIZES:
page = _new_page(app, repository, width, height)
path = output / f"diagnosis_{width}x{height}.png"
paths.append(_save(page, path))
page.close()
app.processEvents()
return paths
def render() -> list[Path]:
app = _application()
root = Path(__file__).resolve().parents[1]
output = root / "artifacts" / "diagnosis_visual"
output.mkdir(parents=True, exist_ok=True)
paths: list[Path] = []
repository = ScreenshotRepository()
for width, height in ((1024, 640), *DENSITY_SIZES, (1440, 900)):
page = _new_page(app, repository, width, height)
path = output / f"diagnosis_{width}x{height}.png"
paths.append(_save(page, path))