Include symbols in Theme
#44
Replies: 2 comments 7 replies
-
Constants are easier and smaller to compile into a binary. They are used in many places. On the other hand, trait methods provide better customization; however, they are much more expensive at runtime. To me, changing symbols to be trait functions seems like a bit of overkill. I would gather more feedback from the community about whether this feature is highly anticipated. |
Beta Was this translation helpful? Give feedback.
-
Just a side-thought, but we could do away with dynamic dispatch all-together, which really isn't needed, with something like: pub struct CliClackTheme<THEME = DefaultTheme>
where
THEME: Theme
{
theme: THEME,
}
impl Default for CliClackTheme<DefaultTheme> {
fn default() -> Self {
Self {
theme: DefaultTheme,
}
}
}
pub struct DefaultTheme;
impl Theme for DefaultTheme {}
pub(crate) static THEME: Lazy<RwLock<CliClackTheme>> = Lazy::new(|| RwLock::new(CliClackTheme::default())); Where a user providing customization would then, like today, provide their own impl of Or better yet, a Then this hangs together with #40 and even with this issue, where the constants could be provided as part of a |
Beta Was this translation helpful? Give feedback.
-
The symbols are constants atm, but I can see where it could be useful to be able to override some of the symbols, for example replacing the hollow-green-diamond with a green-check-mark.
If all of the symbols should be replaceable is a topic for discussion, but I think at least "state" symbols are a valid use-case.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions