pub struct FileBrowser {
pub style: Style,
pub text_color: Color,
/* private fields */
}Fields§
§style: StyleVisual style (background, border).
text_color: ColorText color for interactive entries.
Implementations§
Source§impl FileBrowser
impl FileBrowser
Sourcepub fn new(bounds: Rect) -> Self
pub fn new(bounds: Rect) -> Self
Create a new file browser rooted at the device list.
Call apply_navigation with a
StorageBrowser to populate the initial device list.
Sourcepub fn set_font(&mut self, font: &'static dyn FontMetrics)
pub fn set_font(&mut self, font: &'static dyn FontMetrics)
Assign the font used to render entry names (FONT-00 §5); resolves to
FONT_6X10 when unset.
Sourcepub fn on_file_selected(self, cb: impl FnMut(&str) + 'static) -> Self
pub fn on_file_selected(self, cb: impl FnMut(&str) + 'static) -> Self
Set the callback invoked when a .wav file is double-tapped.
The argument is the full path to the selected file.
Whether a navigation is pending. The application should call
apply_navigation when this returns true.
Apply the pending navigation using the given storage browser. Populates the entry list for the new location.
Sourcepub fn selected_entry(&self) -> Option<&FileEntry>
pub fn selected_entry(&self) -> Option<&FileEntry>
Currently selected entry, if any.
Trait Implementations§
Source§impl Widget for FileBrowser
impl Widget for FileBrowser
Source§fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
fn widget_font_mut(&mut self) -> Option<&mut WidgetFont>
Expose this widget’s font slot for cascade-driven font resolution
(FONT-05 §5.B). Read more
Source§fn handle_event(&mut self, event: &Event) -> bool
fn handle_event(&mut self, event: &Event) -> bool
Handle an event and return
true if it was consumed. Read moreSource§fn clear_region(&mut self) -> Option<Rect>
fn clear_region(&mut self) -> Option<Rect>
Return a region (in draw/landscape coordinates) that should be
restored from the pristine background copy, or
None. Read moreSource§fn set_bounds(&mut self, _bounds: Rect)
fn set_bounds(&mut self, _bounds: Rect)
Called by the LPAR-10 layout pass to notify this widget of its
layout-computed bounds. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FileBrowser
impl !Send for FileBrowser
impl !Sync for FileBrowser
impl !UnwindSafe for FileBrowser
impl Freeze for FileBrowser
impl Unpin for FileBrowser
impl UnsafeUnpin for FileBrowser
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