diff --git a/Cargo.toml b/Cargo.toml index 2d181dd99..83d50e1f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kas" -version = "0.14.2" +version = "0.14.3" authors = ["Diggory Hardy "] edition = "2021" license = "Apache-2.0" @@ -14,10 +14,10 @@ exclude = ["/examples"] rust-version = "1.66.0" [package.metadata.docs.rs] -features = ["nightly"] +features = ["stable"] rustdoc-args = ["--cfg", "doc_cfg"] # To build locally: -# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --features=nightly,internal_doc --all --no-deps --open +# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --features=stable,internal_doc --all --no-deps --open [features] ######### meta / build features ######### @@ -125,7 +125,7 @@ kas-view = { version = "0.14.2", path = "crates/kas-view", optional = true } kas-resvg = { version = "0.14.2", path = "crates/kas-resvg", optional = true } [dependencies.kas-wgpu] -version = "0.14.1" +version = "0.14.2" path = "crates/kas-wgpu" optional = true default-features = false diff --git a/crates/kas-core/Cargo.toml b/crates/kas-core/Cargo.toml index 6b4350ba1..f592a53f6 100644 --- a/crates/kas-core/Cargo.toml +++ b/crates/kas-core/Cargo.toml @@ -15,8 +15,6 @@ exclude = ["/screenshots"] [package.metadata.docs.rs] features = ["stable"] rustdoc-args = ["--cfg", "doc_cfg"] -# To build locally: -# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --features=stable --no-deps --open [features] # All features usable on stable rust diff --git a/crates/kas-resvg/Cargo.toml b/crates/kas-resvg/Cargo.toml index 1d3a6c3cd..938268a98 100644 --- a/crates/kas-resvg/Cargo.toml +++ b/crates/kas-resvg/Cargo.toml @@ -14,10 +14,7 @@ exclude = ["/screenshots"] [package.metadata.docs.rs] features = ["svg", "kas/winit", "kas/wayland"] -all-features = true rustdoc-args = ["--cfg", "doc_cfg"] -# To build locally: -# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open [features] # Support SVG images diff --git a/crates/kas-view/Cargo.toml b/crates/kas-view/Cargo.toml index 248a2f133..d57b4e50e 100644 --- a/crates/kas-view/Cargo.toml +++ b/crates/kas-view/Cargo.toml @@ -15,8 +15,6 @@ exclude = ["/screenshots"] [package.metadata.docs.rs] features = ["kas/winit", "kas/wayland"] rustdoc-args = ["--cfg", "doc_cfg"] -# To build locally: -# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --no-deps --open [dependencies] kas-widgets = { version = "0.14.1", path = "../kas-widgets" } diff --git a/crates/kas-wgpu/Cargo.toml b/crates/kas-wgpu/Cargo.toml index cba18da95..b75623599 100644 --- a/crates/kas-wgpu/Cargo.toml +++ b/crates/kas-wgpu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kas-wgpu" -version = "0.14.1" +version = "0.14.2" authors = ["Diggory Hardy "] edition = "2021" license = "Apache-2.0" @@ -11,6 +11,10 @@ repository = "https://github.com/kas-gui/kas" readme = "README.md" documentation = "https://docs.rs/kas-wgpu/" +[package.metadata.docs.rs] +features = ["kas/winit", "kas/wayland"] +rustdoc-args = ["--cfg", "doc_cfg"] + [features] # WARNING: if "raster" is disabled, an alternative like "kas-text/fontdue" is required! default = ["shaping", "raster"] diff --git a/crates/kas-widgets/Cargo.toml b/crates/kas-widgets/Cargo.toml index 5e7edd444..681eee81e 100644 --- a/crates/kas-widgets/Cargo.toml +++ b/crates/kas-widgets/Cargo.toml @@ -15,8 +15,6 @@ exclude = ["/screenshots"] [package.metadata.docs.rs] features = ["min_spec", "kas/winit", "kas/wayland"] rustdoc-args = ["--cfg", "doc_cfg"] -# To build locally: -# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --no-deps --open [features] # Use min_specialization (enables access key underlining for AccessLabel) diff --git a/crates/kas-widgets/src/lib.rs b/crates/kas-widgets/src/lib.rs index 4d0797a4c..c755aa42e 100644 --- a/crates/kas-widgets/src/lib.rs +++ b/crates/kas-widgets/src/lib.rs @@ -96,6 +96,7 @@ mod tab_stack; mod text; pub use crate::image::Image; +#[cfg(feature = "image")] pub use crate::image::ImageError; pub use button::Button; pub use check_box::{CheckBox, CheckButton}; pub use combobox::ComboBox; diff --git a/crates/kas-widgets/src/text.rs b/crates/kas-widgets/src/text.rs index 7eab34315..c3a49107a 100644 --- a/crates/kas-widgets/src/text.rs +++ b/crates/kas-widgets/src/text.rs @@ -16,12 +16,12 @@ impl_scope! { /// `Text` derives its contents from input data. Use [`Label`](crate::Label) /// instead for fixed contents. /// - /// A text label. Vertical alignment defaults to centred, horizontal - /// alignment depends on the script direction if not specified. - /// Line-wrapping is enabled by default. + /// See also macros [`format_data`] and [`format_value`] which construct a + /// `Text` widget. See also parameterizations [`StrText`], [`StringText`]. /// - /// This type is generic over the text type. - /// See also: [`StrText`], [`StringText`]. + /// Vertical alignment defaults to centred, horizontal alignment depends on + /// the script direction if not specified. Line-wrapping is enabled by + /// default. #[widget] pub struct Text { core: widget_core!(), diff --git a/examples/sync-counter.rs b/examples/sync-counter.rs index b7e6a71eb..bb402bf62 100644 --- a/examples/sync-counter.rs +++ b/examples/sync-counter.rs @@ -27,19 +27,18 @@ impl kas::app::AppData for Count { } fn counter(title: &str) -> Window { - // Per window state: (count, step). + // Per window state: (count, increment). // We must store a local copy of the count in order to have a Data instance // to pass by reference. // (Eventually we may be able to support Adapt forwarding data by reference, // but this would require Rust to support object-safe GATs.) type Data = (Count, i32); - // Initial count is replaced during configure, but initial step is used. + // Initial count is replaced during configure, but initial increment is used. let initial: Data = (Count(0), 1); #[derive(Clone, Debug)] struct SetValue(i32); - // let slider = Slider::<_, _>::new_msg(1..=10, |data: &Data| data.1, SetValue); let slider = Slider::right(1..=10, |_, data: &Data| data.1).with_msg(SetValue); let ui = kas::column![ format_data!(data: &Data, "Count: {}", data.0.0),