pub struct Foreground { /* fields omitted */ }
Foreground of a component.
The foreground of a component. This is used for setting the text, the text alignment and the
vertical text offset.
use leechbar::{Foreground, Text, BarBuilder, Alignment};
let bar = BarBuilder::new().spawn().unwrap();
let text = Text::new(&bar, "Hello, World", None, None).unwrap();
let fg = Foreground::new()
.text(text)
.yoffset(3)
.alignment(Alignment::RIGHT);
Create a new empty Foreground.
use leechbar::Foreground;
let fg = Foreground::new();
Set the text of the foreground.
Default: No text.
use leechbar::{Foreground, Text, BarBuilder};
let bar = BarBuilder::new().spawn().unwrap();
let text = Text::new(&bar, "Text :)", None, None).unwrap();
let fg = Foreground::new().text(text);
Set the alignment of the text inside the component.
Default: Alignment::CENTER
use leechbar::{Foreground, Alignment};
let fg = Foreground::new().alignment(Alignment::RIGHT);
Offset the text vertically. Increasing this offset, moves the text down from the center.
Default: Bar's vertical text offset.
use leechbar::Foreground;
let fg = Foreground::new().yoffset(-3);
Performs copy-assignment from source
. Read more
Returns the "default value" for a type. Read more