Skip to content

Commit

Permalink
Merge pull request #428 from kas-gui/work
Browse files Browse the repository at this point in the history
Doc fixes; pub ImageError
  • Loading branch information
dhardy authored Dec 18, 2023
2 parents e8d3a31 + 642ef5c commit 2e64f9c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kas"
version = "0.14.2"
version = "0.14.3"
authors = ["Diggory Hardy <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -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 #########
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions crates/kas-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions crates/kas-resvg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions crates/kas-view/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
6 changes: 5 additions & 1 deletion crates/kas-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kas-wgpu"
version = "0.14.1"
version = "0.14.2"
authors = ["Diggory Hardy <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -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"]
Expand Down
2 changes: 0 additions & 2 deletions crates/kas-widgets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions crates/kas-widgets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions crates/kas-widgets/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<A, T: Default + FormattableText + 'static> {
core: widget_core!(),
Expand Down
5 changes: 2 additions & 3 deletions examples/sync-counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@ impl kas::app::AppData for Count {
}

fn counter(title: &str) -> Window<Count> {
// 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),
Expand Down

0 comments on commit 2e64f9c

Please sign in to comment.