Struct leechbar::Foreground[][src]

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.

Examples

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);

Methods

impl Foreground
[src]

Create a new empty Foreground.

Examples

use leechbar::Foreground;

let fg = Foreground::new();

Set the text of the foreground.

Default: No text.

Examples

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

Examples

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);

Trait Implementations

impl Clone for Foreground
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl From<Text> for Foreground
[src]

Performs the conversion.

impl Default for Foreground
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Foreground

impl Sync for Foreground