Skip to main content

Module theme

Module theme 

Source
Expand description

Button theme trait - Contract/Connector for button colors

§Architecture Role

ButtonTheme is a CONTRACT/CONNECTOR trait that connects:

  • Factory rendering functions (factory/render.rs)
  • System theme managers (e.g., ToolbarTheme, AppTheme, etc.)

§How It Works

┌─────────────────────────────────────────────────────────┐
│ 1. System Theme Manager (e.g., ToolbarTheme)           │
│    - Stores actual color values                         │
│    - Implements ButtonTheme trait (mapping)             │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│ 2. ButtonTheme trait (THIS MODULE)                      │
│    - Defines contract (which methods/colors needed)     │
│    - Acts as connector interface                        │
└─────────────────────────────────────────────────────────┘
                          ↓
┌─────────────────────────────────────────────────────────┐
│ 3. Factory render functions (factory/render.rs)        │
│    - Accept &dyn ButtonTheme                            │
│    - Call trait methods to get colors                   │
└─────────────────────────────────────────────────────────┘

Structs§

DefaultButtonTheme
Default button theme using prototype colors

Traits§

ButtonTheme
Theme trait for button colors - Contract between system themes and factory rendering