Skip to content

Commit 9bfbd7c

Browse files
committed
Merge branch 'master' into 0.13
2 parents 9458967 + bf3b6f1 commit 9bfbd7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2535
-371
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macOS-latest]
11-
rust: [stable, beta]
11+
rust: [stable, beta, "1.80"]
1212
steps:
1313
- uses: hecrj/setup-rust-action@v2
1414
with:

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.13.1] - 2024-09-19
10+
### Added
11+
- Some `From` trait implementations for `text_input::Id`. [#2582](https://github.com/iced-rs/iced/pull/2582)
12+
- Custom `Executor` support for `Application` and `Daemon`. [#2580](https://github.com/iced-rs/iced/pull/2580)
13+
- `rust-version` metadata to `Cargo.toml`. [#2579](https://github.com/iced-rs/iced/pull/2579)
14+
- Widget examples to API reference. [#2587](https://github.com/iced-rs/iced/pull/2587)
15+
16+
### Fixed
17+
- Inverted scrolling direction with trackpad in `scrollable`. [#2583](https://github.com/iced-rs/iced/pull/2583)
18+
- `scrollable` transactions when `on_scroll` is not set. [#2584](https://github.com/iced-rs/iced/pull/2584)
19+
- Incorrect text color styling in `text_editor` widget. [#2586](https://github.com/iced-rs/iced/pull/2586)
20+
21+
Many thanks to...
22+
- @dcampbell24
23+
- @lufte
24+
- @mtkennerly
25+
926
## [0.13.0] - 2024-09-18
1027
### Added
1128
- Introductory chapters to the [official guide book](https://book.iced.rs/).
@@ -971,7 +988,8 @@ Many thanks to...
971988
### Added
972989
- First release! :tada:
973990

974-
[Unreleased]: https://github.com/iced-rs/iced/compare/0.13.0...HEAD
991+
[Unreleased]: https://github.com/iced-rs/iced/compare/0.13.1...HEAD
992+
[0.13.1]: https://github.com/iced-rs/iced/compare/0.13.0...0.13.1
975993
[0.13.0]: https://github.com/iced-rs/iced/compare/0.12.1...0.13.0
976994
[0.12.1]: https://github.com/iced-rs/iced/compare/0.12.0...0.12.1
977995
[0.12.0]: https://github.com/iced-rs/iced/compare/0.10.0...0.12.0

Cargo.toml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ repository.workspace = true
99
homepage.workspace = true
1010
categories.workspace = true
1111
keywords.workspace = true
12+
rust-version.workspace = true
1213

1314
[lints]
1415
workspace = true
@@ -116,27 +117,28 @@ members = [
116117
]
117118

118119
[workspace.package]
119-
version = "0.13.0"
120+
version = "0.13.1"
120121
authors = ["Héctor Ramón Jiménez <[email protected]>"]
121122
edition = "2021"
122123
license = "MIT"
123124
repository = "https://github.com/iced-rs/iced"
124125
homepage = "https://iced.rs"
125126
categories = ["gui"]
126127
keywords = ["gui", "ui", "graphics", "interface", "widgets"]
128+
rust-version = "1.80"
127129

128130
[workspace.dependencies]
129-
iced = { version = "0.13.0", path = "." }
130-
iced_core = { version = "0.13.0", path = "core" }
131-
iced_futures = { version = "0.13.0", path = "futures" }
132-
iced_graphics = { version = "0.13.0", path = "graphics" }
133-
iced_highlighter = { version = "0.13.0", path = "highlighter" }
134-
iced_renderer = { version = "0.13.0", path = "renderer" }
135-
iced_runtime = { version = "0.13.0", path = "runtime" }
136-
iced_tiny_skia = { version = "0.13.0", path = "tiny_skia" }
137-
iced_wgpu = { version = "0.13.0", path = "wgpu" }
138-
iced_widget = { version = "0.13.0", path = "widget" }
139-
iced_winit = { version = "0.13.0", path = "winit" }
131+
iced = { version = "0.13", path = "." }
132+
iced_core = { version = "0.13", path = "core" }
133+
iced_futures = { version = "0.13", path = "futures" }
134+
iced_graphics = { version = "0.13", path = "graphics" }
135+
iced_highlighter = { version = "0.13", path = "highlighter" }
136+
iced_renderer = { version = "0.13", path = "renderer" }
137+
iced_runtime = { version = "0.13", path = "runtime" }
138+
iced_tiny_skia = { version = "0.13", path = "tiny_skia" }
139+
iced_wgpu = { version = "0.13", path = "wgpu" }
140+
iced_widget = { version = "0.13", path = "widget" }
141+
iced_winit = { version = "0.13", path = "winit" }
140142

141143
async-std = "1.0"
142144
bitflags = "2.0"

ECOSYSTEM.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
A cross-platform GUI library for Rust focused on simplicity and type-safety.
1616
Inspired by [Elm].
1717

18-
<a href="https://iced.rs/examples/todos.mp4">
19-
<img src="https://iced.rs/examples/todos.gif" width="275px">
18+
<a href="https://github.com/squidowl/halloy">
19+
<img src="https://iced.rs/showcase/halloy.gif" width="460px">
2020
</a>
21-
<a href="https://iced.rs/examples/tour.mp4">
22-
<img src="https://iced.rs/examples/tour.gif" width="273px">
21+
<a href="https://github.com/hecrj/icebreaker">
22+
<img src="https://iced.rs/showcase/icebreaker.gif" width="360px">
2323
</a>
2424

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

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

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

6660
## Overview
6761

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

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

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

174168
Since then, the focus has shifted towards providing a batteries-included,
175-
end-user-oriented GUI library, while keeping [the ecosystem] modular:
176-
177-
<p align="center">
178-
<a href="ECOSYSTEM.md">
179-
<img alt="The Iced Ecosystem" src="docs/graphs/ecosystem.png" width="80%">
180-
</a>
181-
</p>
169+
end-user-oriented GUI library, while keeping the ecosystem modular.
182170

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

190177
## Contributing / Feedback
191178

192-
Contributions are greatly appreciated! If you want to contribute, please
193-
read our [contributing guidelines] for more details.
179+
If you want to contribute, please read our [contributing guidelines] for more details.
194180

195181
Feedback is also welcome! You can create a new topic in [our Discourse forum] or
196182
come chat to [our Discord server].

core/src/widget/text.rs

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
//! Write some text for your users to read.
1+
//! Text widgets display information through writing.
2+
//!
3+
//! # Example
4+
//! ```no_run
5+
//! # mod iced { pub mod widget { pub fn text<T>(t: T) -> iced_core::widget::Text<'static, iced_core::Theme, ()> { unimplemented!() } }
6+
//! # pub use iced_core::color; }
7+
//! # pub type State = ();
8+
//! # pub type Element<'a, Message> = iced_core::Element<'a, Message, iced_core::Theme, ()>;
9+
//! use iced::widget::text;
10+
//! use iced::color;
11+
//!
12+
//! enum Message {
13+
//! // ...
14+
//! }
15+
//!
16+
//! fn view(state: &State) -> Element<'_, Message> {
17+
//! text("Hello, this is iced!")
18+
//! .size(20)
19+
//! .color(color!(0x0000ff))
20+
//! .into()
21+
//! }
22+
//! ```
223
use crate::alignment;
324
use crate::layout;
425
use crate::mouse;
@@ -13,7 +34,28 @@ use crate::{
1334

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

16-
/// A paragraph of text.
37+
/// A bunch of text.
38+
///
39+
/// # Example
40+
/// ```no_run
41+
/// # mod iced { pub mod widget { pub fn text<T>(t: T) -> iced_core::widget::Text<'static, iced_core::Theme, ()> { unimplemented!() } }
42+
/// # pub use iced_core::color; }
43+
/// # pub type State = ();
44+
/// # pub type Element<'a, Message> = iced_core::Element<'a, Message, iced_core::Theme, ()>;
45+
/// use iced::widget::text;
46+
/// use iced::color;
47+
///
48+
/// enum Message {
49+
/// // ...
50+
/// }
51+
///
52+
/// fn view(state: &State) -> Element<'_, Message> {
53+
/// text("Hello, this is iced!")
54+
/// .size(20)
55+
/// .color(color!(0x0000ff))
56+
/// .into()
57+
/// }
58+
/// ```
1759
#[allow(missing_debug_implementations)]
1860
pub struct Text<'a, Theme, Renderer>
1961
where

core/src/window/id.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use std::fmt;
12
use std::hash::Hash;
2-
33
use std::sync::atomic::{self, AtomicU64};
44

55
/// The id of the window.
@@ -14,3 +14,9 @@ impl Id {
1414
Id(COUNT.fetch_add(1, atomic::Ordering::Relaxed))
1515
}
1616
}
17+
18+
impl fmt::Display for Id {
19+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20+
self.0.fmt(f)
21+
}
22+
}

examples/multi_window/src/main.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ struct Window {
2525
scale_input: String,
2626
current_scale: f64,
2727
theme: Theme,
28-
input_id: iced::widget::text_input::Id,
2928
}
3029

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

9190
self.windows.insert(id, window);
9291

@@ -163,7 +162,6 @@ impl Window {
163162
scale_input: "1.0".to_string(),
164163
current_scale: 1.0,
165164
theme: Theme::ALL[count % Theme::ALL.len()].clone(),
166-
input_id: text_input::Id::unique(),
167165
}
168166
}
169167

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

188186
let new_window_button =

examples/todos/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ publish = false
99
iced.workspace = true
1010
iced.features = ["async-std", "debug"]
1111

12-
once_cell.workspace = true
1312
serde = { version = "1.0", features = ["derive"] }
1413
serde_json = "1.0"
1514
uuid = { version = "1.0", features = ["v4", "fast-rng", "serde"] }

0 commit comments

Comments
 (0)