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>
impl<R: Resource> WindowBar<R>
Sourcepub fn new(dispatcher: Dispatcher<R>) -> Self
pub fn new(dispatcher: Dispatcher<R>) -> Self
The bar of the window running dispatcher’s record: nothing declared
yet.
Sourcepub fn dispatcher(&self) -> Dispatcher<R>
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.
Sourcepub fn over(self, shell: &NavShell) -> Self
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).
Sourcepub fn under(self, link: &WindowBarLink) -> Self
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.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
The window shows label: its mode, the open document, the place.
Sourcepub fn place(self, location: Option<ToolbarLocation>) -> Self
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).
The window’s sidebar toggle and whether it is open, for a window whose
app shows the sidebar itself: pressing it submits binding.
Sourcepub fn views(
self,
name: impl Into<String>,
chosen: usize,
choices: impl IntoIterator<Item = Choice<R>>,
) -> Self
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).
Sourcepub fn action(self, submit: impl Submit<R>) -> Self
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.
Sourcepub fn effect<E: Effect>(self, effect: &E) -> Self
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.
Sourcepub fn leading(self, submit: impl Submit<R>) -> Self
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.
Sourcepub fn flag(
self,
icon: impl Into<String>,
name: impl Into<String>,
field: &Path<R, bool>,
on: bool,
) -> Self
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.
Sourcepub fn on(self, on: bool) -> Self
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.
The entry declared last goes to the bar’s overflowing menu, never the row: an occasional action (import, export, the app’s settings).
Sourcepub fn named(self, icon: impl Into<String>, name: impl Into<String>) -> Self
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.
Sourcepub fn enabled(self, enabled: bool) -> Self
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.
Sourcepub fn slots(&self) -> WindowToolbar
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.
Sourcepub fn take_events(&self) -> bool
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.
Sourcepub fn press(&self, event: &ToolbarEvent) -> bool
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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 Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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