Skip to main content

MacForm

Struct MacForm 

Source
pub struct MacForm<'a> { /* private fields */ }
Expand description

Authentic macOS AppKit 2-column Form container.

§Example

use egui_macview::{MacAppearance, MacForm, MacTheme, MacToggle};

let theme = MacTheme::new(MacAppearance::Aqua);
let mut hardware_accel = true;

MacForm::new("preferences_form")
    .theme(&theme)
    .show(ui, |form| {
        form.row_label("Hardware Acceleration:", |ui| {
            ui.add(MacToggle::new(&mut hardware_accel).theme(&theme));
        });
    });

Implementations§

Source§

impl<'a> MacForm<'a>

Source

pub fn new(id_salt: impl AsIdSalt) -> Self

Creates a new MacForm with the specified id salt.

Source

pub fn theme(self, theme: &'a MacTheme) -> Self

Sets the dynamic theme to derive AppKit token spacing.

Source

pub fn spacing(self, spacing: impl Into<Vec2>) -> Self

Overrides inter-item spacing between columns and rows in points.

Source

pub fn min_col_width(self, min_col_width: f32) -> Self

Overrides the minimum column width in points.

Source

pub fn show<R>( self, ui: &mut Ui, add_contents: impl FnOnce(&mut MacFormUi<'_>) -> R, ) -> R

Renders the form contents with trailing labels and leading controls.

Auto Trait Implementations§

§

impl<'a> Forget for MacForm<'a>

§

impl<'a> Freeze for MacForm<'a>

§

impl<'a> RefUnwindSafe for MacForm<'a>

§

impl<'a> Send for MacForm<'a>

§

impl<'a> Sync for MacForm<'a>

§

impl<'a> Unpin for MacForm<'a>

§

impl<'a> UnsafeUnpin for MacForm<'a>

§

impl<'a> UnwindSafe for MacForm<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.