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]
fn new() -> Self
[src]
Create a new width without any size restrictions.
Examples
use leechbar::Width; let width = Width::new();
fn fixed(self, fixed: u16) -> Self
[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);
fn min(self, min: u16) -> Self
[src]
Set the minimum width of a component.
Examples
use leechbar::Width; let width = Width::new().min(100);
fn max(self, max: u16) -> Self
[src]
Set the maximum width of a component.
Examples
use leechbar::Width; let width = Width::new().max(100);
fn ignore_background(self) -> Self
[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();
fn ignore_foreground(self) -> Self
[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]
impl Clone for Width
[src]
fn clone(&self) -> Width
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
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]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more