pub struct ScrollPanel {}Expand description
Runtime model that makes a band of UI rows scrollable and (optionally) collapsible.
A ScrollPanel is emitted by the build (e.g. by a settings menu) and read
by the UI at runtime; it is not hand-authored. It names a content band (a
fixed rectangle in the menu’s reference canvas), the ordered rows that live
inside it, the collapsible groups some rows belong to, and the scrollbar
thumb/track sprites. The UI lays the rows out each frame: a collapsed group’s
body rows hide and the rows below them move up; when the visible stack is
taller than the band it scrolls (mouse wheel or thumb drag) and rows outside
the band are clipped.
All pixel fields are in the same reference-space coordinates as the Screen’s other UI (see the overlay scaling notes on MainMenu).
Fields§
§screen: Option<AssetId>Screen this panel belongs to. Resolved automatically from
the <screen>_* naming convention; you don’t set this directly. The
panel is only live while its screen is active.
x: f32Left edge of the content band in reference pixels.
y: f32Top edge of the content band in reference pixels.
width: f32Width of the content band in reference pixels.
height: f32Height of the content band (the visible window) in reference pixels.
rows: Vec<ScrollRow>The rows in the band, top to bottom.
groups: Vec<ScrollGroup>Collapsible groups, referenced by index from ScrollRow::group.
thumb: Option<AssetId>Scrollbar thumb Sprite the UI moves and resizes. None for a
panel with no scrollbar.
track: Option<AssetId>Scrollbar track Sprite. Hidden along with the thumb when the content fits the band.
track_x: f32Left edge of the scrollbar track in reference pixels.
track_y: f32Top edge of the scrollbar track in reference pixels.
track_w: f32Width of the scrollbar track in reference pixels.
track_h: f32Height of the scrollbar track in reference pixels (the thumb travels within it).
Trait Implementations§
Source§impl Clone for ScrollPanel
impl Clone for ScrollPanel
Source§fn clone(&self) -> ScrollPanel
fn clone(&self) -> ScrollPanel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for ScrollPanel
impl Component for ScrollPanel
Source§const NAME: &'static str = "ScrollPanel"
const NAME: &'static str = "ScrollPanel"
Source§fn from_baked(bytes: &[u8]) -> Result<ScrollPanel, CnResult>
fn from_baked(bytes: &[u8]) -> Result<ScrollPanel, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Source§impl ComponentSlot for ScrollPanel
impl ComponentSlot for ScrollPanel
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<ScrollPanel>
fn slot(s: &ComponentStorage) -> &Column<ScrollPanel>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<ScrollPanel>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<ScrollPanel>
Source§impl Debug for ScrollPanel
impl Debug for ScrollPanel
Source§impl Default for ScrollPanel
impl Default for ScrollPanel
Source§fn default() -> ScrollPanel
fn default() -> ScrollPanel
Source§impl<'de> Deserialize<'de> for ScrollPanelwhere
ScrollPanel: Default,
impl<'de> Deserialize<'de> for ScrollPanelwhere
ScrollPanel: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScrollPanel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScrollPanel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<ScrollPanel> for ComponentAsset
impl From<ScrollPanel> for ComponentAsset
Source§fn from(c: ScrollPanel) -> ComponentAsset
fn from(c: ScrollPanel) -> ComponentAsset
impl RuntimeComponent for ScrollPanel
Source§impl Serialize for ScrollPanel
impl Serialize for ScrollPanel
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,
Auto Trait Implementations§
impl Freeze for ScrollPanel
impl RefUnwindSafe for ScrollPanel
impl Send for ScrollPanel
impl Sync for ScrollPanel
impl Unpin for ScrollPanel
impl UnsafeUnpin for ScrollPanel
impl UnwindSafe for ScrollPanel
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().