some styles
This commit is contained in:
@@ -7,6 +7,8 @@ pub struct Style {
|
|||||||
pub hover_bg: Color,
|
pub hover_bg: Color,
|
||||||
pub hover_fg: Color,
|
pub hover_fg: Color,
|
||||||
pub hover_font: Font,
|
pub hover_font: Font,
|
||||||
|
|
||||||
|
is_active: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Style {
|
impl Style {
|
||||||
@@ -19,13 +21,23 @@ impl Style {
|
|||||||
hover_bg: Color::None,
|
hover_bg: Color::None,
|
||||||
hover_fg: Color::None,
|
hover_fg: Color::None,
|
||||||
hover_font: Font::None,
|
hover_font: Font::None,
|
||||||
|
|
||||||
|
is_active: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn update(&mut self, active: bool) {
|
||||||
|
self.is_active = active
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get(self) -> String {
|
pub fn get(self) -> String {
|
||||||
String::from(self.fg.ansi() + &self.bg.ansi_bg() + &self.font.ansi())
|
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 {
|
pub fn get_hover(self) -> String {
|
||||||
String::from(self.hover_fg.ansi() + &self.hover_bg.ansi_bg() + &self.hover_font.ansi())
|
String::from(self.hover_fg.ansi() + &self.hover_bg.ansi_bg() + &self.hover_font.ansi())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user