mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 02:11:25 +01:00
More theme stuff
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user