Mods
This commit is contained in:
parent
554ccfb114
commit
436b5273e5
10
arguments.md
10
arguments.md
|
@ -169,3 +169,13 @@ Show the score on triumph or hits instead of the total of each
|
||||||
Default: False
|
Default: False
|
||||||
|
|
||||||
Action: store_true
|
Action: store_true
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### mono
|
||||||
|
|
||||||
|
Use a monospace font
|
||||||
|
|
||||||
|
Default: False
|
||||||
|
|
||||||
|
Action: store_true
|
||||||
|
|
|
@ -27,6 +27,7 @@ class Args:
|
||||||
slow_minutes: float = 0.0
|
slow_minutes: float = 0.0
|
||||||
argdoc: bool = False
|
argdoc: bool = False
|
||||||
score: bool = False
|
score: bool = False
|
||||||
|
mono: bool = False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def prepare() -> None:
|
def prepare() -> None:
|
||||||
|
@ -58,6 +59,7 @@ class Args:
|
||||||
"slow_minutes",
|
"slow_minutes",
|
||||||
"argdoc",
|
"argdoc",
|
||||||
"score",
|
"score",
|
||||||
|
"mono",
|
||||||
]
|
]
|
||||||
|
|
||||||
for n_item in normals:
|
for n_item in normals:
|
||||||
|
|
|
@ -172,3 +172,9 @@ class ArgSpec:
|
||||||
action="store_true",
|
action="store_true",
|
||||||
info="Show the score on triumph or hits instead of the total of each",
|
info="Show the score on triumph or hits instead of the total of each",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ArgSpec.add_argument(
|
||||||
|
"mono",
|
||||||
|
action="store_true",
|
||||||
|
info="Use a monospace font",
|
||||||
|
)
|
||||||
|
|
|
@ -31,6 +31,7 @@ class Config:
|
||||||
info_separator: str = " - "
|
info_separator: str = " - "
|
||||||
font_path: Path
|
font_path: Path
|
||||||
emoji_font_path: Path
|
emoji_font_path: Path
|
||||||
|
mono_font_path: Path
|
||||||
triumph_color: tuple[int, int, int] = (255, 255, 0)
|
triumph_color: tuple[int, int, int] = (255, 255, 0)
|
||||||
hit_color: tuple[int, int, int] = (255, 0, 77)
|
hit_color: tuple[int, int, int] = (255, 0, 77)
|
||||||
triumph_icon: str = "😀"
|
triumph_icon: str = "😀"
|
||||||
|
@ -97,6 +98,7 @@ class Config:
|
||||||
Config.terminated_image_path = Config.here / "img" / "terminated.jpg"
|
Config.terminated_image_path = Config.here / "img" / "terminated.jpg"
|
||||||
Config.font_path = Config.here / "fonts" / "NotoSans-Regular.ttf"
|
Config.font_path = Config.here / "fonts" / "NotoSans-Regular.ttf"
|
||||||
Config.emoji_font_path = Config.here / "fonts" / "NotoEmoji-Regular.ttf"
|
Config.emoji_font_path = Config.here / "fonts" / "NotoEmoji-Regular.ttf"
|
||||||
|
Config.mono_font_path = Config.here / "fonts" / "NotoSansMono-Regular.ttf"
|
||||||
Config.song_path = Config.here / "audio" / "March of the Cyber Ants.mp3"
|
Config.song_path = Config.here / "audio" / "March of the Cyber Ants.mp3"
|
||||||
Config.logo_path = Config.here / "img" / "logo_3.jpg"
|
Config.logo_path = Config.here / "img" / "logo_3.jpg"
|
||||||
Config.arguments_path = Config.here / ".." / "arguments.md"
|
Config.arguments_path = Config.here / ".." / "arguments.md"
|
||||||
|
|
Binary file not shown.
|
@ -118,6 +118,7 @@ class Window:
|
||||||
info: QPushButton
|
info: QPushButton
|
||||||
font: str
|
font: str
|
||||||
emoji_font: str
|
emoji_font: str
|
||||||
|
mono_font: str
|
||||||
player: QMediaPlayer
|
player: QMediaPlayer
|
||||||
audio: QAudioOutput
|
audio: QAudioOutput
|
||||||
filter: QLineEdit
|
filter: QLineEdit
|
||||||
|
@ -156,6 +157,7 @@ class Window:
|
||||||
def set_style() -> None:
|
def set_style() -> None:
|
||||||
font_id = QFontDatabase.addApplicationFont(str(Config.font_path))
|
font_id = QFontDatabase.addApplicationFont(str(Config.font_path))
|
||||||
emoji_font_id = QFontDatabase.addApplicationFont(str(Config.emoji_font_path))
|
emoji_font_id = QFontDatabase.addApplicationFont(str(Config.emoji_font_path))
|
||||||
|
mono_font_id = QFontDatabase.addApplicationFont(str(Config.mono_font_path))
|
||||||
|
|
||||||
if font_id != -1:
|
if font_id != -1:
|
||||||
Window.font = QFontDatabase.applicationFontFamilies(font_id)[0]
|
Window.font = QFontDatabase.applicationFontFamilies(font_id)[0]
|
||||||
|
@ -163,6 +165,9 @@ class Window:
|
||||||
if emoji_font_id != -1:
|
if emoji_font_id != -1:
|
||||||
Window.emoji_font = QFontDatabase.applicationFontFamilies(emoji_font_id)[0]
|
Window.emoji_font = QFontDatabase.applicationFontFamilies(emoji_font_id)[0]
|
||||||
|
|
||||||
|
if mono_font_id != -1:
|
||||||
|
Window.mono_font = QFontDatabase.applicationFontFamilies(mono_font_id)[0]
|
||||||
|
|
||||||
style = f"""
|
style = f"""
|
||||||
|
|
||||||
QWidget {{
|
QWidget {{
|
||||||
|
@ -255,6 +260,10 @@ class Window:
|
||||||
""".strip()
|
""".strip()
|
||||||
|
|
||||||
Window.app.setStyleSheet(style)
|
Window.app.setStyleSheet(style)
|
||||||
|
|
||||||
|
if Args.mono:
|
||||||
|
Window.app.setFont(Window.mono_font)
|
||||||
|
else:
|
||||||
Window.app.setFont(Window.font)
|
Window.app.setFont(Window.font)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue