-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8652b5e
commit 6433a21
Showing
6 changed files
with
166 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use tauri::{AppHandle, Manager, WebviewWindow}; | ||
|
||
pub fn create_main_window(app: AppHandle) -> WebviewWindow { | ||
if let Some(window) = app.get_webview_window("main") { | ||
println!("Main window already exists, setting focus"); | ||
window.set_focus().ok(); | ||
return window; | ||
} | ||
|
||
println!("Creating new main window"); | ||
let window = WebviewWindow::builder(&app, "main", tauri::WebviewUrl::App("/".into())) | ||
.title("Cap") | ||
.inner_size(300.0, 375.0) | ||
.resizable(false) | ||
.maximized(false) | ||
.shadow(true) | ||
.accept_first_mouse(true) | ||
.transparent(true) | ||
.hidden_title(true) | ||
.title_bar_style(tauri::TitleBarStyle::Overlay) | ||
.theme(Some(tauri::Theme::Light)) | ||
.build() | ||
.unwrap(); | ||
|
||
#[cfg(target_os = "macos")] | ||
{ | ||
use tauri_plugin_decorum::WebviewWindowExt; | ||
|
||
println!("Creating overlay titlebar"); | ||
window.create_overlay_titlebar().unwrap(); | ||
|
||
println!("Setting traffic lights inset for macOS"); | ||
window.set_traffic_lights_inset(14.0, 22.0).unwrap(); | ||
} | ||
|
||
println!("Showing main window"); | ||
window.show().unwrap(); | ||
println!("Main window opened successfully"); | ||
|
||
window | ||
} |
Oops, something went wrong.
6433a21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
cap-web – ./
cap-web-nu.vercel.app
cap-web-git-main-mc-ilroy.vercel.app
www.cap.so
cap.so
cap-web-mc-ilroy.vercel.app