Implement File > Open menu item

This commit is contained in:
Max Brunsfeld
2021-04-08 22:25:54 -07:00
parent f656b387b3
commit 7ebcbdc0cb
7 changed files with 88 additions and 19 deletions
+7
View File
@@ -41,6 +41,7 @@ pub trait App {
options: WindowOptions,
executor: Rc<executor::Foreground>,
) -> Result<Box<dyn Window>>;
fn prompt_for_paths(&self, options: PathPromptOptions) -> Option<Vec<PathBuf>>;
fn fonts(&self) -> Arc<dyn FontSystem>;
fn quit(&self);
}
@@ -66,6 +67,12 @@ pub struct WindowOptions<'a> {
pub title: Option<&'a str>,
}
pub struct PathPromptOptions {
pub files: bool,
pub directories: bool,
pub multiple: bool,
}
pub trait FontSystem: Send + Sync {
fn load_family(&self, name: &str) -> anyhow::Result<Vec<FontId>>;
fn select_font(