This commit is contained in:
David Rice
2026-04-16 20:08:28 +01:00
parent 36fc73a6d5
commit 3a433ce192

View File

@@ -213,10 +213,10 @@ def draw_weather(surface: pygame.Surface, fonts: dict, x: int, y: int) -> None:
surface.blit(fonts['tiny'].render(row2_fn(item), True, WHITE), (cx, start_y + row))
surface.blit(fonts['tiny'].render(row3_fn(item), True, DIM_GRAY), (cx, start_y + 2*row))
# Town name header (small font — bigger than the grid text)
town_h = fonts['small'].get_height()
# Town name header
town_h = fonts['medium'].get_height()
if town:
surface.blit(fonts['small'].render(town, True, GRAY), (x, y))
surface.blit(fonts['medium'].render(town, True, GRAY), (x, y))
if not week:
surface.blit(fonts['tiny'].render('Loading…', True, DIM_GRAY), (x, y + town_h + 4))
@@ -238,9 +238,6 @@ def draw_weather(surface: pygame.Surface, fonts: dict, x: int, y: int) -> None:
lambda h: _trunc(h['desc']))
def draw_dot(surface: pygame.Surface, cx: int, y: int, radius: int = 9) -> None:
pygame.draw.circle(surface, WHITE, (cx, y), radius)
# ── Font helper ───────────────────────────────────────────────────────────────
@@ -272,6 +269,7 @@ def main() -> None:
fonts = {
'large': _load_font(38),
'medium': _load_font(18),
'small': _load_font(13),
'tiny': _load_font(11),
}
@@ -280,7 +278,6 @@ def main() -> None:
face_ry = int(min(W, H) * 0.100)
face_cx = W // 2
face_cy = int(face_ry * 1.2) + 8
dot_y = int(H * 0.895)
clock_block_h = fonts['small'].get_height() + 4 + fonts['large'].get_height()
clock_y = face_cy - clock_block_h // 2
@@ -324,8 +321,7 @@ def main() -> None:
draw_clock(screen, fonts, 20, clock_y)
draw_weather(screen, fonts, weather_x,
clock_y - fonts['small'].get_height() - 4)
draw_dot(screen, W // 2, dot_y)
clock_y - fonts['medium'].get_height() - 4)
pygame.display.flip()
pg_clock.tick(10)