Skip to content

Commit

Permalink
Merge branch 'master' into 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Sep 19, 2024
2 parents 9458967 + bf3b6f1 commit 9bfbd7c
Show file tree
Hide file tree
Showing 43 changed files with 2,535 additions and 371 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, beta]
rust: [stable, beta, "1.80"]
steps:
- uses: hecrj/setup-rust-action@v2
with:
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.13.1] - 2024-09-19
### Added
- Some `From` trait implementations for `text_input::Id`. [#2582](https://github.com/iced-rs/iced/pull/2582)
- Custom `Executor` support for `Application` and `Daemon`. [#2580](https://github.com/iced-rs/iced/pull/2580)
- `rust-version` metadata to `Cargo.toml`. [#2579](https://github.com/iced-rs/iced/pull/2579)
- Widget examples to API reference. [#2587](https://github.com/iced-rs/iced/pull/2587)

### Fixed
- Inverted scrolling direction with trackpad in `scrollable`. [#2583](https://github.com/iced-rs/iced/pull/2583)
- `scrollable` transactions when `on_scroll` is not set. [#2584](https://github.com/iced-rs/iced/pull/2584)
- Incorrect text color styling in `text_editor` widget. [#2586](https://github.com/iced-rs/iced/pull/2586)

Many thanks to...
- @dcampbell24
- @lufte
- @mtkennerly

## [0.13.0] - 2024-09-18
### Added
- Introductory chapters to the [official guide book](https://book.iced.rs/).
Expand Down Expand Up @@ -971,7 +988,8 @@ Many thanks to...
### Added
- First release! :tada:

[Unreleased]: https://github.com/iced-rs/iced/compare/0.13.0...HEAD
[Unreleased]: https://github.com/iced-rs/iced/compare/0.13.1...HEAD
[0.13.1]: https://github.com/iced-rs/iced/compare/0.13.0...0.13.1
[0.13.0]: https://github.com/iced-rs/iced/compare/0.12.1...0.13.0
[0.12.1]: https://github.com/iced-rs/iced/compare/0.12.0...0.12.1
[0.12.0]: https://github.com/iced-rs/iced/compare/0.10.0...0.12.0
Expand Down
26 changes: 14 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repository.workspace = true
homepage.workspace = true
categories.workspace = true
keywords.workspace = true
rust-version.workspace = true

[lints]
workspace = true
Expand Down Expand Up @@ -116,27 +117,28 @@ members = [
]

[workspace.package]
version = "0.13.0"
version = "0.13.1"
authors = ["Héctor Ramón Jiménez <hector@hecrj.dev>"]
edition = "2021"
license = "MIT"
repository = "https://github.com/iced-rs/iced"
homepage = "https://iced.rs"
categories = ["gui"]
keywords = ["gui", "ui", "graphics", "interface", "widgets"]
rust-version = "1.80"

[workspace.dependencies]
iced = { version = "0.13.0", path = "." }
iced_core = { version = "0.13.0", path = "core" }
iced_futures = { version = "0.13.0", path = "futures" }
iced_graphics = { version = "0.13.0", path = "graphics" }
iced_highlighter = { version = "0.13.0", path = "highlighter" }
iced_renderer = { version = "0.13.0", path = "renderer" }
iced_runtime = { version = "0.13.0", path = "runtime" }
iced_tiny_skia = { version = "0.13.0", path = "tiny_skia" }
iced_wgpu = { version = "0.13.0", path = "wgpu" }
iced_widget = { version = "0.13.0", path = "widget" }
iced_winit = { version = "0.13.0", path = "winit" }
iced = { version = "0.13", path = "." }
iced_core = { version = "0.13", path = "core" }
iced_futures = { version = "0.13", path = "futures" }
iced_graphics = { version = "0.13", path = "graphics" }
iced_highlighter = { version = "0.13", path = "highlighter" }
iced_renderer = { version = "0.13", path = "renderer" }
iced_runtime = { version = "0.13", path = "runtime" }
iced_tiny_skia = { version = "0.13", path = "tiny_skia" }
iced_wgpu = { version = "0.13", path = "wgpu" }
iced_widget = { version = "0.13", path = "widget" }
iced_winit = { version = "0.13", path = "winit" }

async-std = "1.0"
bitflags = "2.0"
Expand Down
91 changes: 0 additions & 91 deletions ECOSYSTEM.md

This file was deleted.

36 changes: 11 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
A cross-platform GUI library for Rust focused on simplicity and type-safety.
Inspired by [Elm].

<a href="https://iced.rs/examples/todos.mp4">
<img src="https://iced.rs/examples/todos.gif" width="275px">
<a href="https://github.com/squidowl/halloy">
<img src="https://iced.rs/showcase/halloy.gif" width="460px">
</a>
<a href="https://iced.rs/examples/tour.mp4">
<img src="https://iced.rs/examples/tour.gif" width="273px">
<a href="https://github.com/hecrj/icebreaker">
<img src="https://iced.rs/showcase/icebreaker.gif" width="360px">
</a>

</div>
Expand All @@ -34,34 +34,28 @@ Inspired by [Elm].
* Custom widget support (create your own!)
* [Debug overlay with performance metrics]
* First-class support for async actions (use futures!)
* [Modular ecosystem] split into reusable parts:
* Modular ecosystem split into reusable parts:
* A [renderer-agnostic native runtime] enabling integration with existing systems
* Two [built-in renderers] leveraging [`wgpu`] and [`tiny-skia`]
* Two built-in renderers leveraging [`wgpu`] and [`tiny-skia`]
* [`iced_wgpu`] supporting Vulkan, Metal and DX12
* [`iced_tiny_skia`] offering a software alternative as a fallback
* A [windowing shell]
* A [web runtime] leveraging the DOM

__Iced is currently experimental software.__ [Take a look at the roadmap],
[check out the issues], and [feel free to contribute!]
__Iced is currently experimental software.__ [Take a look at the roadmap] and
[check out the issues].

[Cross-platform support]: https://raw.githubusercontent.com/iced-rs/iced/master/docs/images/todos_desktop.jpg
[text inputs]: https://iced.rs/examples/text_input.mp4
[scrollables]: https://iced.rs/examples/scrollable.mp4
[Debug overlay with performance metrics]: https://iced.rs/examples/debug.mp4
[Modular ecosystem]: ECOSYSTEM.md
[renderer-agnostic native runtime]: runtime/
[`wgpu`]: https://github.com/gfx-rs/wgpu
[`tiny-skia`]: https://github.com/RazrFalcon/tiny-skia
[`iced_wgpu`]: wgpu/
[`iced_tiny_skia`]: tiny_skia/
[built-in renderers]: ECOSYSTEM.md#Renderers
[windowing shell]: winit/
[`dodrio`]: https://github.com/fitzgen/dodrio
[web runtime]: https://github.com/iced-rs/iced_web
[Take a look at the roadmap]: ROADMAP.md
[check out the issues]: https://github.com/iced-rs/iced/issues
[feel free to contribute!]: #contributing--feedback

## Overview

Expand Down Expand Up @@ -164,33 +158,25 @@ Read the [book], the [documentation], and the [examples] to learn more!
## Implementation details

Iced was originally born as an attempt at bringing the simplicity of [Elm] and
[The Elm Architecture] into [Coffee], a 2D game engine I am working on.
[The Elm Architecture] into [Coffee], a 2D game library I am working on.

The core of the library was implemented during May 2019 in [this pull request].
[The first alpha version] was eventually released as
[a renderer-agnostic GUI library]. The library did not provide a renderer and
implemented the current [tour example] on top of [`ggez`], a game library.

Since then, the focus has shifted towards providing a batteries-included,
end-user-oriented GUI library, while keeping [the ecosystem] modular:

<p align="center">
<a href="ECOSYSTEM.md">
<img alt="The Iced Ecosystem" src="docs/graphs/ecosystem.png" width="80%">
</a>
</p>
end-user-oriented GUI library, while keeping the ecosystem modular.

[this pull request]: https://github.com/hecrj/coffee/pull/35
[The first alpha version]: https://github.com/iced-rs/iced/tree/0.1.0-alpha
[a renderer-agnostic GUI library]: https://www.reddit.com/r/rust/comments/czzjnv/iced_a_rendereragnostic_gui_library_focused_on/
[tour example]: examples/README.md#tour
[`ggez`]: https://github.com/ggez/ggez
[the ecosystem]: ECOSYSTEM.md

## Contributing / Feedback

Contributions are greatly appreciated! If you want to contribute, please
read our [contributing guidelines] for more details.
If you want to contribute, please read our [contributing guidelines] for more details.

Feedback is also welcome! You can create a new topic in [our Discourse forum] or
come chat to [our Discord server].
Expand Down
46 changes: 44 additions & 2 deletions core/src/widget/text.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
//! Write some text for your users to read.
//! Text widgets display information through writing.
//!
//! # Example
//! ```no_run
//! # mod iced { pub mod widget { pub fn text<T>(t: T) -> iced_core::widget::Text<'static, iced_core::Theme, ()> { unimplemented!() } }
//! # pub use iced_core::color; }
//! # pub type State = ();
//! # pub type Element<'a, Message> = iced_core::Element<'a, Message, iced_core::Theme, ()>;
//! use iced::widget::text;
//! use iced::color;
//!
//! enum Message {
//! // ...
//! }
//!
//! fn view(state: &State) -> Element<'_, Message> {
//! text("Hello, this is iced!")
//! .size(20)
//! .color(color!(0x0000ff))
//! .into()
//! }
//! ```
use crate::alignment;
use crate::layout;
use crate::mouse;
Expand All @@ -13,7 +34,28 @@ use crate::{

pub use text::{LineHeight, Shaping, Wrapping};

/// A paragraph of text.
/// A bunch of text.
///
/// # Example
/// ```no_run
/// # mod iced { pub mod widget { pub fn text<T>(t: T) -> iced_core::widget::Text<'static, iced_core::Theme, ()> { unimplemented!() } }
/// # pub use iced_core::color; }
/// # pub type State = ();
/// # pub type Element<'a, Message> = iced_core::Element<'a, Message, iced_core::Theme, ()>;
/// use iced::widget::text;
/// use iced::color;
///
/// enum Message {
/// // ...
/// }
///
/// fn view(state: &State) -> Element<'_, Message> {
/// text("Hello, this is iced!")
/// .size(20)
/// .color(color!(0x0000ff))
/// .into()
/// }
/// ```
#[allow(missing_debug_implementations)]
pub struct Text<'a, Theme, Renderer>
where
Expand Down
8 changes: 7 additions & 1 deletion core/src/window/id.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::fmt;
use std::hash::Hash;

use std::sync::atomic::{self, AtomicU64};

/// The id of the window.
Expand All @@ -14,3 +14,9 @@ impl Id {
Id(COUNT.fetch_add(1, atomic::Ordering::Relaxed))
}
}

impl fmt::Display for Id {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}
6 changes: 2 additions & 4 deletions examples/multi_window/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct Window {
scale_input: String,
current_scale: f64,
theme: Theme,
input_id: iced::widget::text_input::Id,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -86,7 +85,7 @@ impl Example {
}
Message::WindowOpened(id) => {
let window = Window::new(self.windows.len() + 1);
let focus_input = text_input::focus(window.input_id.clone());
let focus_input = text_input::focus(format!("input-{id}"));

self.windows.insert(id, window);

Expand Down Expand Up @@ -163,7 +162,6 @@ impl Window {
scale_input: "1.0".to_string(),
current_scale: 1.0,
theme: Theme::ALL[count % Theme::ALL.len()].clone(),
input_id: text_input::Id::unique(),
}
}

Expand All @@ -182,7 +180,7 @@ impl Window {
text("Window title:"),
text_input("Window Title", &self.title)
.on_input(move |msg| { Message::TitleChanged(id, msg) })
.id(self.input_id.clone())
.id(format!("input-{id}"))
];

let new_window_button =
Expand Down
1 change: 0 additions & 1 deletion examples/todos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ publish = false
iced.workspace = true
iced.features = ["async-std", "debug"]

once_cell.workspace = true
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
uuid = { version = "1.0", features = ["v4", "fast-rng", "serde"] }
Expand Down
Loading

0 comments on commit 9bfbd7c

Please sign in to comment.