diff --git a/eframe/Cargo.toml b/eframe/Cargo.toml index e02430862..074131632 100644 --- a/eframe/Cargo.toml +++ b/eframe/Cargo.toml @@ -22,6 +22,9 @@ all-features = true [features] default = ["default_fonts"] +# detect dark mode system preference +dark-light = ["egui-winit/dark-light"] + # If set, egui will use `include_bytes!` to bundle some fonts. # If you plan on specifying your own fonts you may disable this feature. default_fonts = ["egui/default_fonts"] @@ -31,7 +34,6 @@ persistence = [ "egui-winit/persistence", "egui_glow/persistence", "egui/persistence", - "epi/file_storage", "epi/persistence", ] @@ -42,8 +44,6 @@ screen_reader = [ "egui_web/screen_reader", ] -dark-light = ["egui-winit/dark-light"] # detect dark mode system preference - [dependencies] egui = { version = "0.17.0", path = "../egui", default-features = false } diff --git a/egui-winit/Cargo.toml b/egui-winit/Cargo.toml index 48d65c442..578e1a390 100644 --- a/egui-winit/Cargo.toml +++ b/egui-winit/Cargo.toml @@ -20,12 +20,15 @@ all-features = true [features] default = ["clipboard", "dark-light", "links"] +# implement bytemuck on most types. +bytemuck = ["egui/bytemuck"] + # enable cut/copy/paste to OS clipboard. # if disabled a clipboard will be simulated so you can still copy/paste within the egui app. clipboard = ["arboard"] -# implement bytemuck on most types. -bytemuck = ["egui/bytemuck"] +# detect dark mode system preference +dark-light = ["dep:dark-light"] # Only for `egui_glow` - the official eframe/epi backend. epi_backend = ["epi", "glow"] @@ -52,7 +55,7 @@ winit = "0.26.1" epi = { version = "0.17.0", path = "../epi", optional = true } arboard = { version = "2.1", optional = true, default-features = false } -dark-light = { version = "0.2.1", optional = true } # detect dark mode system preference +dark-light = { version = "0.2.1", optional = true } glow = { version = "0.11", optional = true } serde = { version = "1.0", optional = true, features = ["derive"] } webbrowser = { version = "0.6", optional = true } diff --git a/egui_glow/Cargo.toml b/egui_glow/Cargo.toml index 01c0d73f6..b2b3c48c5 100644 --- a/egui_glow/Cargo.toml +++ b/egui_glow/Cargo.toml @@ -28,32 +28,32 @@ default = ["default_fonts"] # enable cut/copy/paste to OS clipboard. # if disabled a clipboard will be simulated so you can still copy/paste within the egui app. -clipboard = ["egui-winit/clipboard"] +clipboard = ["egui-winit?/clipboard"] + +# detect dark mode system preference +dark-light = ["egui-winit?/dark-light"] # If set, egui will use `include_bytes!` to bundle some fonts. # If you plan on specifying your own fonts you may disable this feature. default_fonts = ["egui/default_fonts"] # enable opening links in a browser when an egui hyperlink is clicked. -links = ["egui-winit/links"] +links = ["egui-winit?/links"] # enable persisting native window options and egui memory persistence = [ - "egui-winit/persistence", + "egui-winit?/persistence", "egui/persistence", - "epi?/file_storage", "epi?/persistence", ] # experimental support for a screen reader -screen_reader = ["egui-winit/screen_reader"] +screen_reader = ["egui-winit?/screen_reader"] # enable glutin/winit integration. # if you want to use glow painter on web disable this feature. winit = ["egui-winit", "glutin"] -dark-light = ["egui-winit/dark-light"] # detect dark mode system preference - [dependencies] egui = { version = "0.17.0", path = "../egui", default-features = false, features = [ diff --git a/epi/Cargo.toml b/epi/Cargo.toml index 7e3190f24..8c764fcc6 100644 --- a/epi/Cargo.toml +++ b/epi/Cargo.toml @@ -21,10 +21,9 @@ all-features = true [features] default = [] -# Enable the file_storage module for storing data to disk. -file_storage = ["directories-next", "ron", "serde"] + # Persist native window options and egui memory -persistence = ["ron", "serde", "egui/persistence"] +persistence = ["directories-next", "ron", "serde", "egui/persistence"] [dependencies] @@ -33,6 +32,9 @@ glow = "0.11" tracing = "0.1" # Optional: -directories-next = { version = "2", optional = true } ron = { version = "0.7", optional = true } serde = { version = "1", optional = true } + +# native: +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +directories-next = { version = "2", optional = true } diff --git a/epi/src/lib.rs b/epi/src/lib.rs index 45ce20365..2b25696ff 100644 --- a/epi/src/lib.rs +++ b/epi/src/lib.rs @@ -9,7 +9,8 @@ #![warn(missing_docs)] // Let's keep `epi` well-documented. /// File storage which can be used by native backends. -#[cfg(feature = "file_storage")] +#[cfg(not(target_arch = "wasm32"))] +#[cfg(feature = "persistence")] pub mod file_storage; pub use egui; // Re-export for user convenience diff --git a/sh/check.sh b/sh/check.sh index 5910414e5..08e4b1c98 100755 --- a/sh/check.sh +++ b/sh/check.sh @@ -24,7 +24,7 @@ cargo doc --document-private-items --no-deps --all-features (cd emath && cargo check --no-default-features) (cd epaint && cargo check --no-default-features) (cd epaint && cargo check --no-default-features --release) -(cd egui && cargo check --no-default-features --features "serialize") +(cd egui && cargo check --no-default-features --features "serde") (cd eframe && cargo check --no-default-features) (cd epi && cargo check --no-default-features) (cd egui_demo_lib && cargo check --no-default-features) @@ -42,7 +42,7 @@ cargo doc --document-private-items --no-deps --all-features (cd egui_glium && cargo check --all-features) (cd egui_glow && cargo check --all-features) (cd egui_web && cargo check --all-features) -# (cd egui-winit && cargo check --all-features) can't do, beacause of https://github.com/rust-lang/cargo/issues/8832 +(cd egui-winit && cargo check --all-features) (cd emath && cargo check --all-features) (cd epaint && cargo check --all-features) (cd epi && cargo check --all-features)