From 6323744be01aea5d91785157b1b6995241470599 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Jul 2026 17:35:46 +0000 Subject: [PATCH] Add documentation comments for Theme trait implementations and methods - Document Theme::all() - returns all available themes for dropdown - Document Theme::visuals() - generates egui::Visuals for the theme - Document Display impl - explains conversion to human-readable string - Document FromStr impl - explains config parsing behavior All public APIs now have clear documentation for developers. Co-Authored-By: Claude Haiku 4.5 Claude-Session: https://claude.ai/code/session_019MfSs6q4bYYQvjUXanK7BG --- src/theme.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/theme.rs b/src/theme.rs index 17b6511..dc3c3ae 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -52,6 +52,7 @@ pub enum Theme { } impl Theme { + /// Returns a static slice of all available themes in order. Used to populate the theme selector dropdown. pub fn all() -> &'static [Theme] { &[ Theme::Dark, @@ -94,6 +95,7 @@ impl Theme { ] } + /// Generates the complete egui::Visuals color scheme for this theme. Applied to egui context each frame. pub fn visuals(self) -> egui::Visuals { match self { Theme::Dark => dark_theme(), @@ -137,6 +139,7 @@ impl Theme { } } +/// Converts a theme to its human-readable display string (e.g., "Solarized Dark"). Used in UI dropdowns and config serialization. impl fmt::Display for Theme { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -181,6 +184,7 @@ impl fmt::Display for Theme { } } +/// Parses a theme name from config.json (case-insensitive, handles underscores/spaces). Returns Err(()) on unknown theme. impl FromStr for Theme { type Err = ();