Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.12
version: 1.25.0
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.7.0
ref: v1.7.4
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
Expand All @@ -18,25 +18,25 @@ runtimes:
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- checkov@3.2.435
- actionlint@1.7.7
- taplo@0.9.3
- checkov@3.2.495
- actionlint@1.7.9
- taplo@0.10.0
- yamllint@1.37.1
- mypy@1.15.0
- bandit@1.8.3
- black@25.1.0
- dotenv-linter@3.3.0
- mypy@1.19.0
- bandit@1.9.2
- black@25.11.0
- dotenv-linter@4.0.0
- git-diff-check
- isort@6.0.1
- markdownlint@0.45.0
- osv-scanner@2.0.2
- isort@7.0.0
- markdownlint@0.46.0
- osv-scanner@2.3.0
- oxipng@9.1.5
- prettier@3.5.3
- ruff@0.11.11
- shellcheck@0.10.0
- prettier@3.7.3
- ruff@0.14.7
- shellcheck@0.11.0
- shfmt@3.6.0
- svgo@3.3.2
- trufflehog@3.88.34
- svgo@4.0.0
- trufflehog@3.91.2
ignore:
- linters: [oxipng]
paths:
Expand Down
67 changes: 40 additions & 27 deletions RomM/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from filesystem import Filesystem
from glyps import glyphs
from models import Collection, Platform, Rom
from PIL import Image, ImageDraw, ImageFont
from PIL import Image, ImageDraw, ImageFont, _typing
from status import Status

FONT_FILE = {
Expand Down Expand Up @@ -167,7 +167,7 @@ def draw_text(

def draw_rectangle(
self,
position: ImageDraw.Coords,
position: _typing.Coords,
fill: str | None = None,
outline: str | None = None,
width: int = 1,
Expand All @@ -176,7 +176,7 @@ def draw_rectangle(

def draw_rectangle_r(
self,
position: ImageDraw.Coords,
position: _typing.Coords,
radius: float,
fill: str | None = None,
outline: str | None = None,
Expand All @@ -186,7 +186,7 @@ def draw_rectangle_r(
def row_list(
self,
text: str,
position: ImageDraw.Coords,
position: _typing.Coords,
width: int,
height: int,
selected: bool = False,
Expand All @@ -206,8 +206,12 @@ def row_list(
radius = 5
margin_left_text = 12 + (35 if icon else 0)
margin_top_text = 8

position_0: float = position[0] # type: ignore
position_1: float = position[1] # type: ignore

self.draw_rectangle_r(
[position[0], position[1], position[0] + width, position[1] + height],
[position_0, position_1, position_0 + width, position_1 + height],
radius,
fill=fill if selected else color_row_bg,
outline=outline,
Expand All @@ -218,38 +222,41 @@ def row_list(
margin_top_icon = 5
self.active_image.paste(
icon,
(position[0] + margin_left_icon, position[1] + margin_top_icon),
(int(position_0 + margin_left_icon), int(position_1 + margin_top_icon)),
mask=icon if icon.mode == "RGBA" else None,
)

self.draw_text(
(position[0] + margin_left_text, position[1] + margin_top_text),
(position_0 + margin_left_text, position_1 + margin_top_text),
text,
color=color,
size=size,
)

def draw_circle(
self,
position: ImageDraw.Coords,
position: _typing.Coords,
radius: int,
fill: str | None = None,
outline: str | None = color_text,
):
position_0: float = position[0] # type: ignore
position_1: float = position[1] # type: ignore

self.active_draw.ellipse(
[
position[0] - radius,
position[1] - radius,
position[0] + radius,
position[1] + radius,
position_0 - radius,
position_1 - radius,
position_0 + radius,
position_1 + radius,
],
fill=fill,
outline=outline,
)

def button_circle(
self,
position: ImageDraw.Coords,
position: _typing.Coords,
button: str,
text: str,
color: Optional[str] = None,
Expand All @@ -260,14 +267,17 @@ def button_circle(
btn_text_offset = 1
label_margin_l = 20

position_0: float = position[0] # type: ignore
position_1: float = position[1] # type: ignore

self.draw_circle(position, radius, fill=color, outline=None)
self.draw_text(
(position[0] + btn_text_offset, position[1] + btn_text_offset),
(position_0 + btn_text_offset, position_1 + btn_text_offset),
button,
anchor="mm",
)
self.draw_text(
(position[0] + label_margin_l, position[1] + btn_text_offset),
(position_0 + label_margin_l, position_1 + btn_text_offset),
text,
size="sm",
anchor="lm",
Expand Down Expand Up @@ -578,21 +588,24 @@ def draw_roms_list(

def draw_menu_background(
self,
pos,
width,
n_options,
option_height,
gap,
padding,
extra_top_offset=0,
extra_bottom_offset=0,
pos: _typing.Coords,
width: int,
n_options: int,
option_height: int,
gap: int,
padding: int,
extra_top_offset: int = 0,
extra_bottom_offset: int = 0,
):
position_0: float = pos[0] # type: ignore
position_1: float = pos[1] # type: ignore

self.draw_rectangle_r(
[
pos[0],
pos[1] - extra_top_offset,
pos[0] + width + padding * 2,
pos[1]
position_0,
position_1 - extra_top_offset,
position_0 + width + padding * 2,
position_1
+ n_options * (option_height + gap)
+ padding * 2
- gap
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ description = "A simple muOS app for RomM"
readme = "README.md"
requires-python = ">=3.11,<3.12"
dependencies = [
"pillow>=11.1.0",
"pip>=25.0.1",
"pysdl2>=0.9.17",
"python-dotenv>=1.1.0",
"semver>=3.0.4",
"pillow>=12.0",
"pip>=25.3",
"pysdl2>=0.9",
"python-dotenv>=1.2",
"semver>=3.0",
]
Loading