Diàleg «Quant a» centrat amb icona, nom gran i versió en cursiva
This commit is contained in:
@@ -5,10 +5,14 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtCore import QEasingCurve, QPropertyAnimation, QThreadPool, Qt, QTimer
|
||||
from PySide6.QtGui import QAction, QActionGroup
|
||||
from PySide6.QtGui import QAction, QActionGroup, QPixmap
|
||||
from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QDialog,
|
||||
QDialogButtonBox,
|
||||
QHBoxLayout,
|
||||
QInputDialog,
|
||||
QLabel,
|
||||
QLineEdit,
|
||||
QMainWindow,
|
||||
QMessageBox,
|
||||
@@ -21,6 +25,7 @@ from PySide6.QtWidgets import (
|
||||
|
||||
from .. import __version__, gitops
|
||||
from ..config import Config, Game
|
||||
from ..paths import app_icon_path
|
||||
from ..settings import load_settings, save_settings
|
||||
from ..workers import CheckUpdatesWorker, DownloadWorker, RunWorker
|
||||
from . import theme
|
||||
@@ -257,13 +262,73 @@ class MainWindow(QMainWindow):
|
||||
help_menu.addAction(self.action_about)
|
||||
|
||||
def _show_about(self) -> None:
|
||||
QMessageBox.about(
|
||||
self,
|
||||
f"Quant a {APP_NAME}",
|
||||
f"<b>{APP_NAME}</b><br>"
|
||||
f"Versió {__version__}<br><br>"
|
||||
"© 2026 JailDesigner",
|
||||
)
|
||||
"""Diàleg «Quant a» personalitzat: icona, nom gran i tot centrat."""
|
||||
dlg = QDialog(self)
|
||||
dlg.setWindowTitle(f"Quant a {APP_NAME}")
|
||||
dlg.setModal(True)
|
||||
|
||||
lay = QVBoxLayout(dlg)
|
||||
lay.setContentsMargins(40, 30, 40, 24)
|
||||
lay.setSpacing(0)
|
||||
|
||||
# Logo (si el trobem); s'escala suau des del PNG gran.
|
||||
icon_path = app_icon_path()
|
||||
if icon_path is not None:
|
||||
pix = QPixmap(str(icon_path))
|
||||
if not pix.isNull():
|
||||
logo = QLabel(alignment=Qt.AlignCenter)
|
||||
logo.setPixmap(
|
||||
pix.scaled(
|
||||
96, 96, Qt.KeepAspectRatio, Qt.SmoothTransformation
|
||||
)
|
||||
)
|
||||
lay.addWidget(logo)
|
||||
lay.addSpacing(16)
|
||||
|
||||
# Nom de l'app: gran, en negreta i amb el morat de la marca.
|
||||
name = QLabel(APP_NAME, alignment=Qt.AlignCenter)
|
||||
nf = name.font()
|
||||
nf.setPointSize(nf.pointSize() + 13)
|
||||
nf.setBold(True)
|
||||
name.setFont(nf)
|
||||
name.setStyleSheet("color: #7c4dff;")
|
||||
lay.addWidget(name)
|
||||
lay.addSpacing(4)
|
||||
|
||||
# Versió en cursiva i atenuada.
|
||||
ver = QLabel(f"Versió {__version__}", alignment=Qt.AlignCenter)
|
||||
vf = ver.font()
|
||||
vf.setItalic(True)
|
||||
vf.setPointSize(vf.pointSize() + 1)
|
||||
ver.setFont(vf)
|
||||
ver.setStyleSheet("color: #8a8a8a;")
|
||||
lay.addWidget(ver)
|
||||
lay.addSpacing(18)
|
||||
|
||||
# Lema discret.
|
||||
tag = QLabel("Clona, compila i juga · jailgames", alignment=Qt.AlignCenter)
|
||||
tag.setStyleSheet("color: #8a8a8a;")
|
||||
lay.addWidget(tag)
|
||||
lay.addSpacing(14)
|
||||
|
||||
copy = QLabel("© 2026 JailDesigner", alignment=Qt.AlignCenter)
|
||||
cf = copy.font()
|
||||
cf.setPointSize(cf.pointSize() - 1)
|
||||
copy.setFont(cf)
|
||||
lay.addWidget(copy)
|
||||
lay.addSpacing(24)
|
||||
|
||||
# Botó OK centrat.
|
||||
buttons = QDialogButtonBox(QDialogButtonBox.Ok)
|
||||
buttons.button(QDialogButtonBox.Ok).setText("D'acord")
|
||||
buttons.accepted.connect(dlg.accept)
|
||||
row = QHBoxLayout()
|
||||
row.addStretch(1)
|
||||
row.addWidget(buttons)
|
||||
row.addStretch(1)
|
||||
lay.addLayout(row)
|
||||
|
||||
dlg.exec()
|
||||
|
||||
def _build_theme_menu(self, parent_menu) -> None:
|
||||
"""Submenú Tema amb tres opcions exclusives: Sistema / Clar / Fosc."""
|
||||
|
||||
Reference in New Issue
Block a user