pub struct ContextMenu {
pub open: bool,
pub item_height: usize,
pub width: usize,
pub padding: usize,
pub bg_color: Color,
pub hover_color: Color,
pub text_color: Color,
pub border_color: Color,
pub border_size: usize,
pub radius: usize,
pub font: Option<Font>,
pub font_size: f32,
/* private fields */
}Fields§
§open: bool§item_height: usize§width: usize§padding: usize§bg_color: Color§hover_color: Color§text_color: Color§border_color: Color§border_size: usize§radius: usize§font: Option<Font>§font_size: f32Implementations§
Source§impl ContextMenu
impl ContextMenu
pub fn items(self, items: &[&str]) -> Self
pub fn width(self, w: usize) -> Self
pub fn item_height(self, h: usize) -> Self
pub fn font(self, font: Font, size: f32) -> Self
pub fn bg_color(self, color: Color) -> Self
pub fn hover_color(self, color: Color) -> Self
pub fn text_color(self, color: Color) -> Self
pub fn border_color(self, color: Color) -> Self
pub fn border(self, size: usize) -> Self
pub fn radius(self, radius: usize) -> Self
pub fn is_open(&self) -> bool
Sourcepub fn clicked_item(&self) -> Option<usize>
pub fn clicked_item(&self) -> Option<usize>
Returns the index of the item that was clicked this frame, if any
pub fn draw(&mut self, window: &mut Window)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextMenu
impl RefUnwindSafe for ContextMenu
impl Send for ContextMenu
impl Sync for ContextMenu
impl Unpin for ContextMenu
impl UnsafeUnpin for ContextMenu
impl UnwindSafe for ContextMenu
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