Skip to content

Commit 9c687fa

Browse files
committed
Merge branch 'master' into 0.9
2 parents 0e1a9e6 + c79cc2d commit 9c687fa

Some content is hidden

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

95 files changed

+1769
-886
lines changed

CHANGELOG.md

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

77
## [Unreleased]
88

9+
## [0.9.0] - 2023-04-13
10+
### Added
11+
- `MouseArea` widget. [#1594](https://github.com/iced-rs/iced/pull/1594)
12+
- `channel` helper in `subscription`. [#1786](https://github.com/iced-rs/iced/pull/1786)
13+
- Configurable `width` for `Scrollable`. [#1749](https://github.com/iced-rs/iced/pull/1749)
14+
- Support for disabled `TextInput`. [#1744](https://github.com/iced-rs/iced/pull/1744)
15+
- Platform-specific window settings. [#1730](https://github.com/iced-rs/iced/pull/1730)
16+
- Left and right colors for sliders. [#1643](https://github.com/iced-rs/iced/pull/1643)
17+
- Icon for `TextInput`. [#1702](https://github.com/iced-rs/iced/pull/1702)
18+
- Mouse over scrollbar flag for `scrollable::StyleSheet`. [#1669](https://github.com/iced-rs/iced/pull/1669)
19+
- Better example for `Radio`. [#1762](https://github.com/iced-rs/iced/pull/1762)
20+
21+
### Changed
22+
- `wgpu` has been updated to `0.15` in `iced_wgpu`. [#1789](https://github.com/iced-rs/iced/pull/1789)
23+
- `resvg` has been updated to `0.29` in `iced_graphics`. [#1733](https://github.com/iced-rs/iced/pull/1733)
24+
- `subscription::run` now takes a function pointer. [#1723](https://github.com/iced-rs/iced/pull/1723)
25+
26+
### Fixed
27+
- Redundant `on_scroll` messages for `Scrollable`. [#1788](https://github.com/iced-rs/iced/pull/1788)
28+
- Outdated items in `ROADMAP.md` [#1782](https://github.com/iced-rs/iced/pull/1782)
29+
- Colons in shader labels causing compilation issues in `iced_wgpu`. [#1779](https://github.com/iced-rs/iced/pull/1779)
30+
- Re-expose winit features for window servers in Linux. [#1777](https://github.com/iced-rs/iced/pull/1777)
31+
- Replacement of application node in Wasm. [#1765](https://github.com/iced-rs/iced/pull/1765)
32+
- `clippy` lints for Rust 1.68. [#1755](https://github.com/iced-rs/iced/pull/1755)
33+
- Unnecessary `Component` rebuilds. [#1754](https://github.com/iced-rs/iced/pull/1754)
34+
- Incorrect package name in checkbox example docs. [#1750](https://github.com/iced-rs/iced/pull/1750)
35+
- Fullscreen only working on primary monitor. [#1742](https://github.com/iced-rs/iced/pull/1742)
36+
- `Padding::fit` on irregular values for an axis. [#1734](https://github.com/iced-rs/iced/pull/1734)
37+
- `Debug` implementation of `Font` displaying its bytes. [#1731](https://github.com/iced-rs/iced/pull/1731)
38+
- Sliders bleeding over their rail. [#1721](https://github.com/iced-rs/iced/pull/1721)
39+
40+
### Removed
41+
- `Fill` variant for `Alignment`. [#1735](https://github.com/iced-rs/iced/pull/1735)
42+
43+
Many thanks to...
44+
45+
- @ahoneybun
46+
- @bq-wrongway
47+
- @bungoboingo
48+
- @casperstorm
49+
- @Davidster
50+
- @ElhamAryanpur
51+
- @FinnPerry
52+
- @GyulyVGC
53+
- @JungleTryne
54+
- @lupd
55+
- @mmstick
56+
- @nicksenger
57+
- @Night-Hunter-NF
58+
- @tarkah
59+
- @traxys
60+
- @Xaeroxe
61+
962
## [0.8.0] - 2023-02-18
1063
### Added
1164
- Generic pixel units. [#1711](https://github.com/iced-rs/iced/pull/1711)
@@ -414,7 +467,8 @@ Many thanks to...
414467
### Added
415468
- First release! :tada:
416469

417-
[Unreleased]: https://github.com/iced-rs/iced/compare/0.8.0...HEAD
470+
[Unreleased]: https://github.com/iced-rs/iced/compare/0.9.0...HEAD
471+
[0.9.0]: https://github.com/iced-rs/iced/compare/0.8.0...0.9.0
418472
[0.8.0]: https://github.com/iced-rs/iced/compare/0.7.0...0.8.0
419473
[0.7.0]: https://github.com/iced-rs/iced/compare/0.6.0...0.7.0
420474
[0.6.0]: https://github.com/iced-rs/iced/compare/0.5.0...0.6.0

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iced"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Héctor Ramón Jiménez <[email protected]>"]
55
edition = "2021"
66
description = "A cross-platform GUI library inspired by Elm"
@@ -66,13 +66,13 @@ members = [
6666
]
6767

6868
[dependencies]
69-
iced_core = { version = "0.8", path = "core" }
69+
iced_core = { version = "0.9", path = "core" }
7070
iced_futures = { version = "0.6", path = "futures" }
71-
iced_native = { version = "0.9", path = "native" }
72-
iced_graphics = { version = "0.7", path = "graphics" }
73-
iced_winit = { version = "0.8", path = "winit", features = ["application"] }
74-
iced_glutin = { version = "0.7", path = "glutin", optional = true }
75-
iced_glow = { version = "0.7", path = "glow", optional = true }
71+
iced_native = { version = "0.10", path = "native" }
72+
iced_graphics = { version = "0.8", path = "graphics" }
73+
iced_winit = { version = "0.9", path = "winit", features = ["application"] }
74+
iced_glutin = { version = "0.8", path = "glutin", optional = true }
75+
iced_glow = { version = "0.8", path = "glow", optional = true }
7676
thiserror = "1.0"
7777

7878
[dependencies.image_rs]
@@ -81,10 +81,10 @@ package = "image"
8181
optional = true
8282

8383
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
84-
iced_wgpu = { version = "0.9", path = "wgpu", optional = true }
84+
iced_wgpu = { version = "0.10", path = "wgpu", optional = true }
8585

8686
[target.'cfg(target_arch = "wasm32")'.dependencies]
87-
iced_wgpu = { version = "0.9", path = "wgpu", features = ["webgl"], optional = true }
87+
iced_wgpu = { version = "0.10", path = "wgpu", features = ["webgl"], optional = true }
8888

8989
[package.metadata.docs.rs]
9090
rustdoc-args = ["--cfg", "docsrs"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ __Iced is currently experimental software.__ [Take a look at the roadmap],
6868
Add `iced` as a dependency in your `Cargo.toml`:
6969

7070
```toml
71-
iced = "0.8"
71+
iced = "0.9"
7272
```
7373

7474
If your project is using a Rust edition older than 2021, then you will need to
@@ -215,7 +215,7 @@ cargo run --features iced/glow --package game_of_life
215215
and then use it in your project with
216216

217217
```toml
218-
iced = { version = "0.8", default-features = false, features = ["glow"] }
218+
iced = { version = "0.9", default-features = false, features = ["glow"] }
219219
```
220220

221221
__NOTE:__ Chances are you have hardware that supports at least OpenGL 2.1 or OpenGL ES 2.0,

ROADMAP.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Once a step is completed, it is collapsed and added to this list:
1919
* [x] Custom styling ([#146])
2020
* [x] Canvas for 2D graphics ([#193])
2121
* [x] Basic overlay support ([#444])
22+
* [x] Animations [#31]
2223

2324
[#24]: https://github.com/iced-rs/iced/issues/24
2425
[#25]: https://github.com/iced-rs/iced/issues/25
@@ -29,6 +30,7 @@ Once a step is completed, it is collapsed and added to this list:
2930
[#146]: https://github.com/iced-rs/iced/pull/146
3031
[#193]: https://github.com/iced-rs/iced/pull/193
3132
[#444]: https://github.com/iced-rs/iced/pull/444
33+
[#31]: https://github.com/iced-rs/iced/issues/31
3234

3335
### Multi-window support ([#27])
3436
Open and control multiple windows at runtime.
@@ -39,23 +41,15 @@ This approach should also allow us to perform custom optimizations for this part
3941

4042
[#27]: https://github.com/iced-rs/iced/issues/27
4143

42-
### Animations ([#31])
43-
Allow widgets to request a redraw at a specific time.
44-
45-
This is a necessary feature to render loading spinners, a blinking text cursor, GIF images, etc.
46-
47-
[`winit`] allows flexible control of its event loop. We may be able to use [`ControlFlow::WaitUntil`](https://docs.rs/winit/0.20.0-alpha3/winit/event_loop/enum.ControlFlow.html#variant.WaitUntil) for this purpose.
48-
49-
[#31]: https://github.com/iced-rs/iced/issues/31
50-
51-
### Canvas widget for 3D graphics ([#32])
44+
### Canvas widget for 3D graphics (~~[#32]~~ [#343])
5245
A widget to draw freely in 3D. It could be used to draw charts, implement a Paint clone, a CAD application, etc.
5346

5447
As a first approach, we could expose the underlying renderer directly here, and couple this widget with it ([`wgpu`] for now). Once [`wgpu`] gets WebGL or WebGPU support, this widget will be able to run on the web too. The renderer primitive could be a simple texture that the widget draws to.
5548

5649
In the long run, we could expose a renderer-agnostic abstraction to perform the drawing.
5750

5851
[#32]: https://github.com/iced-rs/iced/issues/32
52+
[#343] https://github.com/iced-rs/iced/issues/343
5953

6054
### Text shaping and font fallback ([#33])
6155
[`wgpu_glyph`] uses [`glyph_brush`], which in turn uses [`rusttype`]. While the current implementation is able to layout text quite nicely, it does not perform any [text shaping].

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iced_core"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Héctor Ramón Jiménez <[email protected]>"]
55
edition = "2021"
66
description = "The essential concepts of Iced"

core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This crate is meant to be a starting point for an Iced runtime.
1818
Add `iced_core` as a dependency in your `Cargo.toml`:
1919

2020
```toml
21-
iced_core = "0.8"
21+
iced_core = "0.9"
2222
```
2323

2424
__Iced moves fast and the `master` branch can contain breaking changes!__ If

core/src/alignment.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ pub enum Alignment {
1111

1212
/// Align at the end of the axis.
1313
End,
14-
15-
/// Fill the entire axis.
16-
Fill,
1714
}
1815

1916
impl From<Horizontal> for Alignment {

core/src/font.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/// A font.
2-
#[derive(Debug, Clone, Copy)]
2+
#[derive(Debug, Clone, Copy, Default)]
33
pub enum Font {
44
/// The default font.
55
///
66
/// This is normally a font configured in a renderer or loaded from the
77
/// system.
8+
#[default]
89
Default,
910

1011
/// An external font.
@@ -16,9 +17,3 @@ pub enum Font {
1617
bytes: &'static [u8],
1718
},
1819
}
19-
20-
impl Default for Font {
21-
fn default() -> Font {
22-
Font::Default
23-
}
24-
}

core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! ![The foundations of the Iced ecosystem](https://github.com/iced-rs/iced/blob/0525d76ff94e828b7b21634fa94a747022001c83/docs/graphs/foundations.png?raw=true)
88
//!
99
//! [Iced]: https://github.com/iced-rs/iced
10-
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.8/native
10+
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.9/native
1111
//! [`iced_web`]: https://github.com/iced-rs/iced_web
1212
#![doc(
1313
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"

core/src/mouse/interaction.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/// The interaction of a mouse cursor.
2-
#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord)]
2+
#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord, Default)]
33
#[allow(missing_docs)]
44
pub enum Interaction {
5+
#[default]
56
Idle,
67
Pointer,
78
Grab,
@@ -11,10 +12,5 @@ pub enum Interaction {
1112
Grabbing,
1213
ResizingHorizontally,
1314
ResizingVertically,
14-
}
15-
16-
impl Default for Interaction {
17-
fn default() -> Interaction {
18-
Interaction::Idle
19-
}
15+
NotAllowed,
2016
}

core/src/padding.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ impl Padding {
7777
/// Fits the [`Padding`] between the provided `inner` and `outer` [`Size`].
7878
pub fn fit(self, inner: Size, outer: Size) -> Self {
7979
let available = (outer - inner).max(Size::ZERO);
80+
let new_top = self.top.min(available.height);
81+
let new_left = self.left.min(available.width);
8082

8183
Padding {
82-
top: self.top.min(available.height / 2.0),
83-
right: self.right.min(available.width / 2.0),
84-
bottom: self.bottom.min(available.height / 2.0),
85-
left: self.left.min(available.width / 2.0),
84+
top: new_top,
85+
bottom: self.bottom.min(available.height - new_top),
86+
left: new_left,
87+
right: self.right.min(available.width - new_left),
8688
}
8789
}
8890
}

docs/release_summary.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import re
2+
import sys
3+
import requests
4+
from typing import List, Tuple
5+
6+
if len(sys.argv) < 3:
7+
print("Usage: python release_summary.py <personal_access_token> <previous_release_branch>")
8+
exit(1)
9+
10+
TOKEN = sys.argv[1]
11+
HEADERS = {"Authorization": f"Bearer {TOKEN}"}
12+
PR_COMMIT_REGEX = re.compile(r"(?i)Merge pull request #(\d+).*")
13+
14+
def get_merged_prs_since_release(repo: str, previous_release_branch: str) -> List[Tuple[str, int, str, str]]:
15+
prs = []
16+
compare_url = f"https://api.github.com/repos/{repo}/compare/{previous_release_branch}...master"
17+
compare_response = requests.get(compare_url, headers=HEADERS)
18+
19+
if compare_response.status_code == 200:
20+
compare_data = compare_response.json()
21+
for commit in compare_data["commits"]:
22+
match = PR_COMMIT_REGEX.search(commit["commit"]["message"])
23+
if match:
24+
pr_number = int(match.group(1))
25+
pr_url = f"https://api.github.com/repos/{repo}/pulls/{pr_number}"
26+
pr_response = requests.get(pr_url, headers=HEADERS)
27+
if pr_response.status_code == 200:
28+
pr_data = pr_response.json()
29+
prs.append((pr_data["title"], pr_number, pr_data["html_url"], pr_data["user"]["login"]))
30+
else:
31+
print(f"Error fetching PR {pr_number}: {pr_response.status_code}")
32+
else:
33+
print(f"Error comparing branches: {compare_response.status_code}")
34+
35+
return prs
36+
37+
def print_pr_list(prs: List[Tuple[str, int, str, str]]):
38+
for pr in prs:
39+
print(f"- {pr[0]}. [#{pr[1]}]({pr[2]})")
40+
41+
def print_authors(prs: List[Tuple[str, int, str, str]]):
42+
authors = set(pr[3] for pr in prs)
43+
print("\nAuthors:")
44+
for author in sorted(authors, key=str.casefold):
45+
print(f"- @{author}")
46+
47+
if __name__ == "__main__":
48+
repo = "iced-rs/iced"
49+
previous_release_branch = sys.argv[2]
50+
merged_prs = get_merged_prs_since_release(repo, previous_release_branch)
51+
print_pr_list(merged_prs)
52+
print_authors(merged_prs)

examples/checkbox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The __[`main`]__ file contains all the code of the example.
66

77
You can run it with `cargo run`:
88
```
9-
cargo run --package pick_list
9+
cargo run --package checkbox
1010
```
1111

1212
[`main`]: src/main.rs

examples/component/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ mod numeric_input {
127127
.horizontal_alignment(alignment::Horizontal::Center)
128128
.vertical_alignment(alignment::Vertical::Center),
129129
)
130-
.width(50)
130+
.width(40)
131+
.height(40)
131132
.on_press(on_press)
132133
};
133134

@@ -140,12 +141,12 @@ mod numeric_input {
140141
.map(u32::to_string)
141142
.as_deref()
142143
.unwrap_or(""),
143-
Event::InputChanged,
144144
)
145+
.on_input(Event::InputChanged)
145146
.padding(10),
146147
button("+", Event::IncrementPressed),
147148
]
148-
.align_items(Alignment::Fill)
149+
.align_items(Alignment::Center)
149150
.spacing(10)
150151
.into()
151152
}

0 commit comments

Comments
 (0)