pub struct Layout {
pub show: BTreeMap<String, Show>,
pub order: BTreeMap<String, Vec<String>>,
}Expand description
What the interface shows: the modes and orders that differ from the defaults.
Fields§
§show: BTreeMap<String, Show>Element id → how it is shown.
order: BTreeMap<String, Vec<String>>Region id → element ids in the order wanted. Ids a region doesn’t have are skipped; those it has but the list doesn’t name follow, in their default order.
Implementations§
Source§impl Layout
impl Layout
pub fn is_default(&self) -> bool
Sourcepub fn show(&self, id: &str) -> Show
pub fn show(&self, id: &str) -> Show
How element (or plugin view) id is shown. Unknown ids are shown.
Sourcepub fn visible(&self, id: &str, hovered: bool) -> bool
pub fn visible(&self, id: &str, hovered: bool) -> bool
Whether id is drawn now (hovered: the pointer is on what it belongs to).
Sourcepub fn set_show(&mut self, id: &str, mode: Show)
pub fn set_show(&mut self, id: &str, mode: Show)
Set how id is shown; back to the default stores nothing.
Sourcepub fn arrange(&self, region: &str, extra: &[String]) -> Vec<String>
pub fn arrange(&self, region: &str, extra: &[String]) -> Vec<String>
Region region’s elements in order: byob’s own (in ELEMENTS order) and then
extra (plugin views drawn there, as found), arranged by the stored order. Hidden
ones are included; ask Self::show.
Sourcepub fn set_order(&mut self, region: &str, ids: Vec<String>)
pub fn set_order(&mut self, region: &str, ids: Vec<String>)
Put region region in this order (see Self::order); the default order stores nothing.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layout
impl<'de> Deserialize<'de> for Layout
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Layout, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Layout, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Layout
Source§impl Serialize for Layout
impl Serialize for Layout
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Forget for Layout
impl Freeze for Layout
impl Move for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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
Mutably borrows from an owned value. Read more