font size

This commit is contained in:
Mateusz Gruszczyński
2026-06-03 23:18:39 +02:00
parent 6365ee3a88
commit 0877dbdf0f
9 changed files with 22 additions and 17 deletions
+10
View File
@@ -472,6 +472,7 @@ def save_preferences(data: dict, user_id: int | None = None):
disk_monitor_stop_enabled = data.get("disk_monitor_stop_enabled")
disk_monitor_stop_threshold = data.get("disk_monitor_stop_threshold")
interface_scale = data.get("interface_scale")
torrent_list_font_size = data.get("torrent_list_font_size")
compact_torrent_list_enabled = data.get("compact_torrent_list_enabled")
detail_panel_height = data.get("detail_panel_height")
disk_payload = None
@@ -510,6 +511,15 @@ def save_preferences(data: dict, user_id: int | None = None):
if scale < 80: scale = 80
if scale > 140: scale = 140
conn.execute("UPDATE user_preferences SET interface_scale=?, updated_at=? WHERE user_id=?", (scale, now, user_id))
if torrent_list_font_size is not None:
# Note: Torrent list font size is clamped so dense rows cannot break the virtualized list layout.
try:
list_font_size = int(torrent_list_font_size or 13)
except (TypeError, ValueError):
list_font_size = 13
if list_font_size < 11: list_font_size = 11
if list_font_size > 16: list_font_size = 16
conn.execute("UPDATE user_preferences SET torrent_list_font_size=?, updated_at=? WHERE user_id=?", (list_font_size, now, user_id))
if compact_torrent_list_enabled is not None:
# Note: Compact torrent list is a visual-only preference for desktop and mobile list density.
conn.execute("UPDATE user_preferences SET compact_torrent_list_enabled=?, updated_at=? WHERE user_id=?", (1 if compact_torrent_list_enabled else 0, now, user_id))