mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-04-19 09:10:18 +00:00
24 lines
679 B
Python
24 lines
679 B
Python
from PySide6.QtGui import QFont
|
|
|
|
from .focusSelectAllLineEdit import FocusSelectAllLineEdit
|
|
|
|
|
|
class ArcaeaScoreLineEdit(FocusSelectAllLineEdit):
|
|
def __init__(self, parent=None):
|
|
super().__init__(parent)
|
|
|
|
font = QFont("GeosansLight")
|
|
font.setPointSize(14)
|
|
font.setBold(True)
|
|
font.setStyleStrategy(
|
|
QFont.StyleStrategy.NoSubpixelAntialias
|
|
| QFont.StyleStrategy.PreferAntialias
|
|
)
|
|
self.setFont(font)
|
|
|
|
self.setInputMask("B9'999'999;_")
|
|
|
|
def score(self) -> int | None:
|
|
textWithoutMask = self.text().replace("'", "")
|
|
return int(textWithoutMask) if textWithoutMask else None
|