libadwaita::builders

Struct ToggleBuilder

source
pub struct ToggleBuilder { /* private fields */ }
Available on crate feature v1_7 only.
Expand description

A builder-pattern type to construct Toggle objects.

Implementations§

source§

impl ToggleBuilder

source

pub fn child(self, child: &impl IsA<Widget>) -> Self

The toggle child.

When the child is set, icon and label are not displayed.

It’s recommended to still set the label, as it can still be used by the screen reader.

source

pub fn enabled(self, enabled: bool) -> Self

Whether this toggle is enabled.

source

pub fn icon_name(self, icon_name: impl Into<GString>) -> Self

The toggle icon name.

The icon will be displayed alone or next to the label, unless child is set.

source

pub fn label(self, label: impl Into<GString>) -> Self

The toggle label.

The label will be displayed alone or next to the icon, unless child is set, but will stil be read out by the screen reader.

source

pub fn name(self, name: impl Into<GString>) -> Self

The toggle name.

Allows accessing the toggle by its name instead of index.

See active-name.

source

pub fn tooltip(self, tooltip: impl Into<GString>) -> Self

The tooltip of the toggle.

The tooltip can be marked up with the Pango text markup language.

source

pub fn use_underline(self, use_underline: bool) -> Self

Whether an embedded underline in the label indicates a mnemonic.

See label.

source

pub fn build(self) -> Toggle

Build the Toggle.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.