diff --git a/README.md b/README.md index d5225249..9cfa06e5 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Put the package in your `Cargo.toml`. ```toml [dependencies] -promkit = "0.4.1" +promkit = "0.4.2" ``` ## Features diff --git a/promkit-async/Cargo.toml b/promkit-async/Cargo.toml index 446a3476..947975c3 100644 --- a/promkit-async/Cargo.toml +++ b/promkit-async/Cargo.toml @@ -17,5 +17,5 @@ anyhow = "1.0.81" crossterm = { version = "0.27.0", features = ["use-dev-tty", "event-stream"] } futures = "0.3.30" futures-timer = "3.0.3" -promkit = "0.4.0" +promkit = "=0.4.0" tokio = { version = "1.36.0", features = ["full"] } diff --git a/promkit/Cargo.toml b/promkit/Cargo.toml index af917da3..b04c2877 100644 --- a/promkit/Cargo.toml +++ b/promkit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "promkit" -version = "0.4.1" +version = "0.4.2" authors = ["ynqa "] edition = "2021" description = "A toolkit for building your own interactive command-line tools" diff --git a/promkit/src/core/listbox/state.rs b/promkit/src/core/listbox/state.rs index 756e345b..73bd8b8c 100644 --- a/promkit/src/core/listbox/state.rs +++ b/promkit/src/core/listbox/state.rs @@ -37,7 +37,13 @@ impl PaneFactory for State { .filter(|(i, _)| *i >= self.listbox.position() && *i < self.listbox.position() + height) .map(|(i, item)| { if i == self.listbox.position() { - StyledGraphemes::from_iter([&StyledGraphemes::from(&self.cursor), item]) + let init = + StyledGraphemes::from_iter([&StyledGraphemes::from(&self.cursor), item]); + if let Some(style) = &self.active_item_style { + init.apply_style(*style) + } else { + init + } } else { let init = StyledGraphemes::from_iter([ &StyledGraphemes::from( @@ -45,7 +51,7 @@ impl PaneFactory for State { ), item, ]); - if let Some(style) = &self.active_item_style { + if let Some(style) = &self.inactive_item_style { init.apply_style(*style) } else { init diff --git a/promkit/src/lib.rs b/promkit/src/lib.rs index db10981f..6a5bd095 100644 --- a/promkit/src/lib.rs +++ b/promkit/src/lib.rs @@ -11,7 +11,7 @@ //! //! ```toml //! [dependencies] -//! promkit = "0.4.1" +//! promkit = "0.4.2" //! ``` //! //! ## Features @@ -19,13 +19,13 @@ //! - Support cross-platform both UNIX and Windows owing to [crossterm](https://github.com/crossterm-rs/crossterm) //! - Various building methods //! - Preset; Support for quickly setting up a UI by providing simple parameters. -//! - [Readline](https://github.com/ynqa/promkit/tree/v0.4.1#readline) -//! - [Confirm](https://github.com/ynqa/promkit/tree/v0.4.1#confirm) -//! - [Password](https://github.com/ynqa/promkit/tree/v0.4.1#password) -//! - [Select](https://github.com/ynqa/promkit/tree/v0.4.1#select) -//! - [QuerySelect](https://github.com/ynqa/promkit/tree/v0.4.1#queryselect) -//! - [Checkbox](https://github.com/ynqa/promkit/tree/v0.4.1#checkbox) -//! - [Tree](https://github.com/ynqa/promkit/tree/v0.4.1#tree) +//! - [Readline](https://github.com/ynqa/promkit/tree/v0.4.2#readline) +//! - [Confirm](https://github.com/ynqa/promkit/tree/v0.4.2#confirm) +//! - [Password](https://github.com/ynqa/promkit/tree/v0.4.2#password) +//! - [Select](https://github.com/ynqa/promkit/tree/v0.4.2#select) +//! - [QuerySelect](https://github.com/ynqa/promkit/tree/v0.4.2#queryselect) +//! - [Checkbox](https://github.com/ynqa/promkit/tree/v0.4.2#checkbox) +//! - [Tree](https://github.com/ynqa/promkit/tree/v0.4.2#tree) //! - Combining various UI components. //! - They are provided with the same interface, allowing users to choose and //! assemble them according to their preferences. @@ -39,7 +39,7 @@ //! //! ## Examples/Demos //! -//! See [here](https://github.com/ynqa/promkit/tree/v0.4.1#examplesdemos) +//! See [here](https://github.com/ynqa/promkit/tree/v0.4.2#examplesdemos) //! //! ## Why *promkit*? //!