Skip to content

Commit

Permalink
fix: Create title_styles function for multiple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
icidasset committed Jan 15, 2023
1 parent 958a929 commit 904ead6
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src-tauri/src/main.rs
Expand Up @@ -75,18 +75,29 @@ fn build_window(app: tauri::AppHandle) {
WindowUrl::App(PathBuf::from("index.html"))
)
.title("Diffuse")
.hidden_title(true)
.maximized(true)
.resizable(true)
.theme(None)
.enable_clipboard_access()
.user_agent("Chrome");

if cfg!(target_os = "macos") {
builder = builder.title_bar_style(TitleBarStyle::Overlay);
}
builder = title_styles(builder);

builder
.build()
.unwrap();
}


#[cfg(target_os = "macos")]
fn title_styles(builder: WindowBuilder) -> WindowBuilder {
return builder
.title_bar_style(TitleBarStyle::Overlay)
.hidden_title(true);
}


#[cfg(not(target_os = "macos"))]
fn title_styles(builder: WindowBuilder) -> WindowBuilder {
return builder;
}

0 comments on commit 904ead6

Please sign in to comment.