Forgot that windows has no [Appname] -> equivelent. Placed settings into edit menu.
This commit is contained in:
parent
babe4557fc
commit
901bc2f2ea
|
|
@ -75,6 +75,14 @@ impl App {
|
|||
MenuAction::Save => self.save_file(),
|
||||
MenuAction::SaveAs => self.save_file_as(),
|
||||
MenuAction::NewNote => self.new_note(),
|
||||
MenuAction::Settings => {
|
||||
// Open config file in the default editor.
|
||||
let cfg = dirs::home_dir()
|
||||
.unwrap_or_default()
|
||||
.join(".acord")
|
||||
.join("config.json");
|
||||
let _ = std::process::Command::new("notepad").arg(&cfg).spawn();
|
||||
}
|
||||
MenuAction::Undo => { /* TODO */ },
|
||||
MenuAction::Redo => { /* TODO */ },
|
||||
MenuAction::ExportCrate => { /* TODO */ },
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ pub enum MenuAction {
|
|||
ZoomOut,
|
||||
ZoomReset,
|
||||
Find,
|
||||
Settings,
|
||||
ExportCrate,
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +55,8 @@ impl AppMenu {
|
|||
edit.append(&PredefinedMenuItem::separator()).ok();
|
||||
edit.append(&MenuItem::with_id("find", "Find...", true, Some(Accelerator::new(Some(Modifiers::CONTROL), Code::KeyF)))).ok();
|
||||
edit.append(&PredefinedMenuItem::separator()).ok();
|
||||
edit.append(&MenuItem::with_id("settings", "Settings...", true, Some(Accelerator::new(Some(Modifiers::CONTROL), Code::Comma)))).ok();
|
||||
edit.append(&PredefinedMenuItem::separator()).ok();
|
||||
edit.append(&MenuItem::with_id("bold", "Bold", true, Some(Accelerator::new(Some(Modifiers::CONTROL), Code::KeyB)))).ok();
|
||||
edit.append(&MenuItem::with_id("italic", "Italic", true, Some(Accelerator::new(Some(Modifiers::CONTROL), Code::KeyI)))).ok();
|
||||
edit.append(&MenuItem::with_id("table", "Insert Table", true, Some(Accelerator::new(Some(Modifiers::CONTROL), Code::KeyT)))).ok();
|
||||
|
|
@ -99,6 +102,7 @@ impl AppMenu {
|
|||
"zoom_out" => Some(MenuAction::ZoomOut),
|
||||
"zoom_reset" => Some(MenuAction::ZoomReset),
|
||||
"find" => Some(MenuAction::Find),
|
||||
"settings" => Some(MenuAction::Settings),
|
||||
"export_crate" => Some(MenuAction::ExportCrate),
|
||||
_ => None,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue