More theme stuff

This commit is contained in:
Gregory Schier
2024-05-24 17:36:48 -07:00
parent 3e8c01f436
commit 696e72323b
17 changed files with 142 additions and 68 deletions

View File

@@ -1292,6 +1292,15 @@ async fn cmd_update_folder(folder: Folder, w: WebviewWindow) -> Result<Folder, S
upsert_folder(&w, folder).await.map_err(|e| e.to_string())
}
#[tauri::command]
async fn cmd_write_file_dev(w: WebviewWindow, pathname: &str, contents: &str) -> Result<(), String> {
if !is_dev() {
panic!("Cannot write arbitrary files when not in dev mode");
}
fs::write(pathname, contents).map_err(|e| e.to_string())
}
#[tauri::command]
async fn cmd_delete_folder(w: WebviewWindow, folder_id: &str) -> Result<Folder, String> {
delete_folder(&w, folder_id)
@@ -1669,6 +1678,7 @@ pub fn run() {
cmd_update_http_request,
cmd_update_settings,
cmd_update_workspace,
cmd_write_file_dev,
])
.build(tauri::generate_context!())
.expect("error while running tauri application")

View File

@@ -107,15 +107,15 @@ pub fn app_menu(app_handle: &AppHandle) -> tauri::Result<Menu<Wry>> {
&PredefinedMenuItem::fullscreen(app_handle, None)?,
#[cfg(target_os = "macos")]
&PredefinedMenuItem::separator(app_handle)?,
// &MenuItemBuilder::with_id("zoom_reset".to_string(), "Zoom to Actual Size")
// .accelerator("CmdOrCtrl+0")
// .build(app_handle)?,
// &MenuItemBuilder::with_id("zoom_in".to_string(), "Zoom In")
// .accelerator("CmdOrCtrl+=")
// .build(app_handle)?,
// &MenuItemBuilder::with_id("zoom_out".to_string(), "Zoom Out")
// .accelerator("CmdOrCtrl+-")
// .build(app_handle)?,
&MenuItemBuilder::with_id("zoom_reset".to_string(), "Zoom to Actual Size")
.accelerator("CmdOrCtrl+0")
.build(app_handle)?,
&MenuItemBuilder::with_id("zoom_in".to_string(), "Zoom In")
.accelerator("CmdOrCtrl+=")
.build(app_handle)?,
&MenuItemBuilder::with_id("zoom_out".to_string(), "Zoom Out")
.accelerator("CmdOrCtrl+-")
.build(app_handle)?,
],
)?,
&window_menu,