Skip to main content

WindowBar

Struct WindowBar 

Source
pub struct WindowBar<R: Resource> { /* private fields */ }
Expand description

The window’s bar: the slots the app declares now, and what pressing each of them submits.

Implementations§

Source§

impl<R: Resource> WindowBar<R>

Source

pub fn new(dispatcher: Dispatcher<R>) -> Self

The bar of the window running dispatcher’s record: nothing declared yet.

Source

pub fn dispatcher(&self) -> Dispatcher<R>

The dispatcher this bar’s actions are submitted through: what a window keeps to declare its bar anew for what it shows now.

Source

pub fn over(self, shell: &NavShell) -> Self

Start from shell’s own slots — its sidebar toggle, Back, the inspector toggle — and hand it the presses on them. The shell draws no header row of its own (NavShell::with_window_toolbar).

Source

pub fn under(self, link: &WindowBarLink) -> Self

Start from the slots the shell of link last laid out, for an app painted inside the shell’s content column.

Source

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

The window shows label: its mode, the open document, the place.

Source

pub fn place(self, location: Option<ToolbarLocation>) -> Self

The window’s location whole: its label, its choices, its breadcrumb, the anchor it reopens at (ToolbarLocation); None where the window shows no location (its sidebar stands in front of the content).

Source

pub fn sidebar(self, open: bool, binding: impl Binding<R>) -> Self

The window’s sidebar toggle and whether it is open, for a window whose app shows the sidebar itself: pressing it submits binding.

Source

pub fn views( self, name: impl Into<String>, chosen: usize, choices: impl IntoIterator<Item = Choice<R>>, ) -> Self

The app’s views of what the window shows — Issues and Board, Month and Week — as its view switcher: chosen is the place in choices of the one shown now, and choosing one submits what it carries (the effect that shows it).

Source

pub fn action(self, submit: impl Submit<R>) -> Self

The button that submits submit — a verb with its arguments, a field edit, a form — named and pictured as the action is declared, disabled where the participant may not take it. The framework submits it through the window’s dispatcher when it is pressed.

Source

pub fn effect<E: Effect>(self, effect: &E) -> Self

The button that invokes effect, named and pictured as it is declared, and disabled where the participant may not take it. The effect is answered wherever the app answers that effect: the window’s own view, or the host.

Source

pub fn leading(self, submit: impl Submit<R>) -> Self

The action submit as a leading action: on where the window is (previous, next, today), right after the navigation.

Source

pub fn flag( self, icon: impl Into<String>, name: impl Into<String>, field: &Path<R, bool>, on: bool, ) -> Self

The record’s flag at field as a toggle: it shows on, and pressing it submits the opposite, disabled where the participant may not edit the record.

Source

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

The entry declared last shows as pressed when on and as a toggle: an effect that sets one of a window’s own states (a unit, a panel) reads as the state it sets.

Source

pub fn in_menu(self) -> Self

The entry declared last goes to the bar’s overflowing menu, never the row: an occasional action (import, export, the app’s settings).

Source

pub fn named(self, icon: impl Into<String>, name: impl Into<String>) -> Self

The entry declared last is pictured by icon and named name: the window’s own words for what the record’s action or effect calls itself, where the bar names it differently.

Source

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

The entry declared last is enabled only where enabled too: what it would do is possible only sometimes (a theme that must be legible before it applies), and never where the participant may not take it.

Source

pub fn slots(&self) -> WindowToolbar

The slots as the app declared them: the shell’s own, then the app’s, in the row and in the menu.

Source

pub fn declare(&self)

Declare these slots as the window’s.

Source

pub fn take_events(&self) -> bool

Submit what the person pressed in the window’s bar since the last call: on the shell’s own slots, the sidebar toggle, then the record’s actions and effects. Returns whether anything was asked.

Source

pub fn press(&self, event: &ToolbarEvent) -> bool

Submit one event the bar sent. Returns whether it was one of these slots (then it is handled, even where the slot is gone).

Auto Trait Implementations§

§

impl<R> !Freeze for WindowBar<R>

§

impl<R> !RefUnwindSafe for WindowBar<R>

§

impl<R> !Send for WindowBar<R>

§

impl<R> !Sync for WindowBar<R>

§

impl<R> Unpin for WindowBar<R>

§

impl<R> UnsafeUnpin for WindowBar<R>

§

impl<R> !UnwindSafe for WindowBar<R>

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
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

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

§

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

§

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

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,