persiitent styles
Python CI / test (push) Successful in 4m9s

This commit is contained in:
2025-11-08 19:31:05 +01:00
parent 11dc30ba8d
commit 4811367905
6 changed files with 661 additions and 1 deletions
+15 -1
View File
@@ -78,10 +78,11 @@ class LibraryState:
@dataclass
class Settings:
"""User settings"""
"""User settings for rendering and display"""
font_scale: float = 1.0
line_spacing: int = 5
inter_block_spacing: int = 15
word_spacing: int = 0 # Default word spacing
brightness: int = 8
theme: str = "day"
@@ -96,6 +97,7 @@ class Settings:
font_scale=data.get('font_scale', 1.0),
line_spacing=data.get('line_spacing', 5),
inter_block_spacing=data.get('inter_block_spacing', 15),
word_spacing=data.get('word_spacing', 0),
brightness=data.get('brightness', 8),
theme=data.get('theme', 'day')
)
@@ -374,6 +376,18 @@ class StateManager:
setattr(self.state.settings, key, value)
self._dirty = True
def update_settings(self, settings_dict: Dict[str, Any]):
"""
Update multiple settings at once.
Args:
settings_dict: Dictionary with setting keys and values
"""
for key, value in settings_dict.items():
if hasattr(self.state.settings, key):
setattr(self.state.settings, key, value)
self._dirty = True
def get_library_state(self) -> LibraryState:
"""Get library state"""
return self.state.library