pub struct DropdownView {
pub anchor: [f32; 4],
pub options: Vec<String>,
pub selected: usize,
pub first: usize,
pub hovered: Option<usize>,
pub screen: Option<AssetId>,
pub font: Option<FontHandle>,
pub scale: f32,
pub color: [f32; 3],
}Expand description
What GraphicsSystem needs to draw an open dropdown list: the anchor control
rect (reference space), the option labels top-to-bottom, the selected +
hovered OPTION indices to highlight, the scroll position (first, the top
shown option of a list longer than the layout window), and the row value
label’s font / scale / color so the list text matches the row it drops from.
Fields§
§anchor: [f32; 4]Anchor control rect in reference space.
options: Vec<String>Option labels, top to bottom.
selected: usizeIndex of the selected option.
first: usizeIndex of the top shown option, for a scrolled list.
hovered: Option<usize>Index of the hovered option, if any.
screen: Option<AssetId>The screen the row belongs to, when it belongs to one.
font: Option<FontHandle>Font of the row’s value label, so list text matches it.
scale: f32Text scale of the row’s value label.
color: [f32; 3]Linear RGB text colour of the row’s value label.
Trait Implementations§
Source§impl Clone for DropdownView
impl Clone for DropdownView
Source§fn clone(&self) -> DropdownView
fn clone(&self) -> DropdownView
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DropdownView
impl RefUnwindSafe for DropdownView
impl Send for DropdownView
impl Sync for DropdownView
impl Unpin for DropdownView
impl UnsafeUnpin for DropdownView
impl UnwindSafe for DropdownView
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