some styles

This commit is contained in:
2024-10-20 11:38:15 +02:00
parent d79809b41f
commit 7ce86753fa
+12
View File
@@ -7,6 +7,8 @@ pub struct Style {
pub hover_bg: Color,
pub hover_fg: Color,
pub hover_font: Font,
is_active: bool,
}
impl Style {
@@ -19,13 +21,23 @@ impl Style {
hover_bg: Color::None,
hover_fg: Color::None,
hover_font: Font::None,
is_active: false,
}
}
pub fn update(&mut self, active: bool) {
self.is_active = active
}
pub fn get(self) -> String {
String::from(self.fg.ansi() + &self.bg.ansi_bg() + &self.font.ansi())
}
pub fn get_outline(self) -> String {
String::from(self.fg.ansi() + &self.bg.ansi_bg() + &self.font.ansi())
}
pub fn get_hover(self) -> String {
String::from(self.hover_fg.ansi() + &self.hover_bg.ansi_bg() + &self.hover_font.ansi())
}