pub(crate) struct NavItem {
row: Retained<NSBox>,
icon: Option<Retained<NSImageView>>,
title: Retained<NSTextField>,
badge: Retained<NSTextField>,
button: Retained<RowButton>,
target: Retained<ClickTarget>,
look: Rc<RowLook>,
}Expand description
The row’s views, under a button that covers the whole row and draws nothing itself: it takes clicks anywhere on the row, tracks the pointer, and carries the title for screen readers.
Fields§
§row: Retained<NSBox>§icon: Option<Retained<NSImageView>>§title: Retained<NSTextField>§badge: Retained<NSTextField>§target: Retained<ClickTarget>§look: Rc<RowLook>Implementations§
pub(crate) fn new( mtm: MainThreadMarker, title: &str, icon: Icon, badge: &str, selected: bool, on_click: ClickHandler, ) -> Self
pub(crate) fn view(&self) -> &NSView
pub(crate) fn set_title(&self, title: &str)
pub(crate) fn set_selected(&self, selected: bool)
pub(crate) fn set_badge(&self, badge: &str)
pub(crate) fn measure(&self) -> Size
Sourcepub(crate) fn set_frame(&self, frame: Frame)
pub(crate) fn set_frame(&self, frame: Frame)
Places the row, then lays out its views across it, each centered vertically.
Sourcepub(crate) fn remove(self)
pub(crate) fn remove(self)
Released at the end of the current event, since the click may be running now.
fn icon_width(&self) -> f32
fn badge_width(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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