mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-11 22:21:58 +00:00
M7: links open in the browser in the desktop app, What's new on the update prompt among them (#2216)
The desktop app built eframe without its `links` feature, so egui-winit dropped every `ctx.open_url` with only a log warning: the update prompt's What's new link and Download button, the About and Credits links, Terms in Live and the link in the Dev Mode panel did nothing on click. The feature adds no crate: `webbrowser` is already a dependency of the app. DeckCraft's desktop app builds eframe with it too. `links_in_the_interface_open_in_the_browser` fails without the feature. Co-authored-by: Oleksii Sukholita <oleksii.sukholita@gmail.com>
This commit is contained in:
co-authored by
Oleksii Sukholita
parent
41c1ad3458
commit
74698fa89f
Generated
+1
@@ -1547,6 +1547,7 @@ dependencies = [
|
||||
"raw-window-handle",
|
||||
"smithay-clipboard",
|
||||
"web-time",
|
||||
"webbrowser",
|
||||
"windows-sys 0.61.2",
|
||||
"winit",
|
||||
]
|
||||
|
||||
@@ -23,7 +23,9 @@ craft-window = { workspace = true }
|
||||
# The suite's settings folder: `FIGCRAFT_CONFIG_DIR`, a portable marker, then the platform folder.
|
||||
craft-settings = { workspace = true }
|
||||
egui = { workspace = true }
|
||||
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "clipboard", "wayland", "x11"] }
|
||||
# `links`: without it eframe drops every `ctx.open_url` and hyperlink click (the update prompt's
|
||||
# What's new and Download, About, Credits) with only a log warning.
|
||||
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "clipboard", "links", "wayland", "x11"] }
|
||||
serde_json = { workspace = true }
|
||||
log = { workspace = true }
|
||||
rfd = { workspace = true }
|
||||
|
||||
@@ -142,3 +142,13 @@ fn the_next_dialog_starts_in_the_folder_of_the_last_pick() {
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
assert_eq!(start_folder(Some(dir)), None, "a folder deleted since: the system's own");
|
||||
}
|
||||
|
||||
/// The update prompt's What's new and Download, and the About and Credits links, open through
|
||||
/// `ctx.open_url`. eframe drops those with only a log warning unless it is built with `links`.
|
||||
#[test]
|
||||
fn links_in_the_interface_open_in_the_browser() {
|
||||
let manifest = include_str!("../Cargo.toml");
|
||||
let eframe: Vec<&str> = manifest.lines().filter(|l| l.trim_start().starts_with("eframe =")).collect();
|
||||
assert!(!eframe.is_empty(), "the app depends on eframe");
|
||||
assert!(eframe.iter().any(|l| l.contains("\"links\"")), "eframe is built with `links`: {eframe:?}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user