Struct leechbar::Width [] [src]

pub struct Width { /* fields omitted */ }

Width of a component.

This can override the width set by text or background. It can also be used to impose restraints on the component's size.

Examples

use leechbar::Width;

// Width with min and max restrictions
let width = Width::new()
                  .ignore_background()
                  .min(100)
                  .max(300);

// No width restrictions
let width = Width::new();

Methods

impl Width
[src]

[src]

Create a new width without any size restrictions.

Examples

use leechbar::Width;

let width = Width::new();

[src]

Set the component to a fixed with. This overrides min, max, background and text width.

Examples

use leechbar::Width;

let width = Width::new().fixed(100);

[src]

Set the minimum width of a component.

Examples

use leechbar::Width;

let width = Width::new().min(100);

[src]

Set the maximum width of a component.

Examples

use leechbar::Width;

let width = Width::new().max(100);

[src]

When this is set, the width of the background is ignored. It is useful if you want to fit a background image to the width of the text.

Examples

use leechbar::Width;

let width = Width::new().ignore_background();

[src]

When this is set, the width of the foreground is ignored. It is useful if you want to fit text to the width of the background. This will usually lead to text being cut off.

Examples

use leechbar::Width;

let width = Width::new().ignore_foreground();

Trait Implementations

impl Default for Width
[src]

[src]

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

impl Clone for Width
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Width
[src]

impl Eq for Width
[src]

impl Hash for Width
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Width
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.