Skip to content

Commit

Permalink
Make webbrowser non-optional, and version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper-Bekkers committed Nov 22, 2024
1 parent 27e6fcd commit d590d60
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
5 changes: 1 addition & 4 deletions crates/egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ bytemuck = ["egui/bytemuck"]
## If disabled a clipboard will be simulated so you can still copy/paste within the egui app.
clipboard = ["arboard", "smithay-clipboard"]

## Enable opening links in a browser when an egui hyperlink is clicked.
links = ["webbrowser"]

## Enable profiling with the [`puffin`](https://docs.rs/puffin) crate.
puffin = ["dep:puffin", "egui/puffin"]

Expand Down Expand Up @@ -71,7 +68,7 @@ document-features = { workspace = true, optional = true }

puffin = { workspace = true, optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
webbrowser = { version = "1", optional = true }
webbrowser = { version = "1" }

[target.'cfg(any(target_os="linux", target_os="dragonfly", target_os="freebsd", target_os="netbsd", target_os="openbsd"))'.dependencies]
smithay-clipboard = { version = "0.7.0", optional = true }
Expand Down
6 changes: 0 additions & 6 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -977,15 +977,9 @@ pub fn update_viewport_info(
}

fn open_url_in_browser(_url: &str) {
#[cfg(feature = "webbrowser")]
if let Err(err) = webbrowser::open(_url) {
log::warn!("Failed to open url: {}", err);
}

#[cfg(not(feature = "webbrowser"))]
{
log::warn!("Cannot open url - feature \"links\" not enabled.");
}
}

/// Winit sends special keys (backspace, delete, F1, …) as characters.
Expand Down

0 comments on commit d590d60

Please sign in to comment.