Skip to content

Commit

Permalink
feat: add change window height method (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
tu6ge authored Nov 28, 2024
1 parent a4af8c7 commit b92d8d8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ fn main() {
.invoke_handler(tauri::generate_handler![
show_panel,
hide_panel,
close_panel
close_panel,
change_window_height
])
.setup(|app| {
init(app.app_handle());
Expand Down Expand Up @@ -57,6 +58,16 @@ fn init(app_handle: &AppHandle) {
panel.set_delegate(delegate);
}


#[tauri::command]
fn change_window_height(handle: AppHandle,height: u32) {
let window: WebviewWindow = handle.get_webview_window("main").unwrap();

let mut size = window.outer_size().unwrap();
size.height = height;
window.set_size(size).unwrap();
}

#[tauri::command]
fn show_panel(handle: AppHandle) {
let panel = handle.get_webview_panel("main").unwrap();
Expand Down

0 comments on commit b92d8d8

Please # to comment.