Skip to content

Commit

Permalink
Merge branch 'master' into 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Apr 13, 2023
2 parents 0e1a9e6 + c79cc2d commit 9c687fa
Show file tree
Hide file tree
Showing 95 changed files with 1,769 additions and 886 deletions.
56 changes: 55 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.9.0] - 2023-04-13
### Added
- `MouseArea` widget. [#1594](https://github.com/iced-rs/iced/pull/1594)
- `channel` helper in `subscription`. [#1786](https://github.com/iced-rs/iced/pull/1786)
- Configurable `width` for `Scrollable`. [#1749](https://github.com/iced-rs/iced/pull/1749)
- Support for disabled `TextInput`. [#1744](https://github.com/iced-rs/iced/pull/1744)
- Platform-specific window settings. [#1730](https://github.com/iced-rs/iced/pull/1730)
- Left and right colors for sliders. [#1643](https://github.com/iced-rs/iced/pull/1643)
- Icon for `TextInput`. [#1702](https://github.com/iced-rs/iced/pull/1702)
- Mouse over scrollbar flag for `scrollable::StyleSheet`. [#1669](https://github.com/iced-rs/iced/pull/1669)
- Better example for `Radio`. [#1762](https://github.com/iced-rs/iced/pull/1762)

### Changed
- `wgpu` has been updated to `0.15` in `iced_wgpu`. [#1789](https://github.com/iced-rs/iced/pull/1789)
- `resvg` has been updated to `0.29` in `iced_graphics`. [#1733](https://github.com/iced-rs/iced/pull/1733)
- `subscription::run` now takes a function pointer. [#1723](https://github.com/iced-rs/iced/pull/1723)

### Fixed
- Redundant `on_scroll` messages for `Scrollable`. [#1788](https://github.com/iced-rs/iced/pull/1788)
- Outdated items in `ROADMAP.md` [#1782](https://github.com/iced-rs/iced/pull/1782)
- Colons in shader labels causing compilation issues in `iced_wgpu`. [#1779](https://github.com/iced-rs/iced/pull/1779)
- Re-expose winit features for window servers in Linux. [#1777](https://github.com/iced-rs/iced/pull/1777)
- Replacement of application node in Wasm. [#1765](https://github.com/iced-rs/iced/pull/1765)
- `clippy` lints for Rust 1.68. [#1755](https://github.com/iced-rs/iced/pull/1755)
- Unnecessary `Component` rebuilds. [#1754](https://github.com/iced-rs/iced/pull/1754)
- Incorrect package name in checkbox example docs. [#1750](https://github.com/iced-rs/iced/pull/1750)
- Fullscreen only working on primary monitor. [#1742](https://github.com/iced-rs/iced/pull/1742)
- `Padding::fit` on irregular values for an axis. [#1734](https://github.com/iced-rs/iced/pull/1734)
- `Debug` implementation of `Font` displaying its bytes. [#1731](https://github.com/iced-rs/iced/pull/1731)
- Sliders bleeding over their rail. [#1721](https://github.com/iced-rs/iced/pull/1721)

### Removed
- `Fill` variant for `Alignment`. [#1735](https://github.com/iced-rs/iced/pull/1735)

Many thanks to...

- @ahoneybun
- @bq-wrongway
- @bungoboingo
- @casperstorm
- @Davidster
- @ElhamAryanpur
- @FinnPerry
- @GyulyVGC
- @JungleTryne
- @lupd
- @mmstick
- @nicksenger
- @Night-Hunter-NF
- @tarkah
- @traxys
- @Xaeroxe

## [0.8.0] - 2023-02-18
### Added
- Generic pixel units. [#1711](https://github.com/iced-rs/iced/pull/1711)
Expand Down Expand Up @@ -414,7 +467,8 @@ Many thanks to...
### Added
- First release! :tada:

[Unreleased]: https://github.com/iced-rs/iced/compare/0.8.0...HEAD
[Unreleased]: https://github.com/iced-rs/iced/compare/0.9.0...HEAD
[0.9.0]: https://github.com/iced-rs/iced/compare/0.8.0...0.9.0
[0.8.0]: https://github.com/iced-rs/iced/compare/0.7.0...0.8.0
[0.7.0]: https://github.com/iced-rs/iced/compare/0.6.0...0.7.0
[0.6.0]: https://github.com/iced-rs/iced/compare/0.5.0...0.6.0
Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iced"
version = "0.8.0"
version = "0.9.0"
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
edition = "2021"
description = "A cross-platform GUI library inspired by Elm"
Expand Down Expand Up @@ -66,13 +66,13 @@ members = [
]

[dependencies]
iced_core = { version = "0.8", path = "core" }
iced_core = { version = "0.9", path = "core" }
iced_futures = { version = "0.6", path = "futures" }
iced_native = { version = "0.9", path = "native" }
iced_graphics = { version = "0.7", path = "graphics" }
iced_winit = { version = "0.8", path = "winit", features = ["application"] }
iced_glutin = { version = "0.7", path = "glutin", optional = true }
iced_glow = { version = "0.7", path = "glow", optional = true }
iced_native = { version = "0.10", path = "native" }
iced_graphics = { version = "0.8", path = "graphics" }
iced_winit = { version = "0.9", path = "winit", features = ["application"] }
iced_glutin = { version = "0.8", path = "glutin", optional = true }
iced_glow = { version = "0.8", path = "glow", optional = true }
thiserror = "1.0"

[dependencies.image_rs]
Expand All @@ -81,10 +81,10 @@ package = "image"
optional = true

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

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

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ __Iced is currently experimental software.__ [Take a look at the roadmap],
Add `iced` as a dependency in your `Cargo.toml`:

```toml
iced = "0.8"
iced = "0.9"
```

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

```toml
iced = { version = "0.8", default-features = false, features = ["glow"] }
iced = { version = "0.9", default-features = false, features = ["glow"] }
```

__NOTE:__ Chances are you have hardware that supports at least OpenGL 2.1 or OpenGL ES 2.0,
Expand Down
14 changes: 4 additions & 10 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Once a step is completed, it is collapsed and added to this list:
* [x] Custom styling ([#146])
* [x] Canvas for 2D graphics ([#193])
* [x] Basic overlay support ([#444])
* [x] Animations [#31]

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

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

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

### Animations ([#31])
Allow widgets to request a redraw at a specific time.

This is a necessary feature to render loading spinners, a blinking text cursor, GIF images, etc.

[`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.

[#31]: https://github.com/iced-rs/iced/issues/31

### Canvas widget for 3D graphics ([#32])
### Canvas widget for 3D graphics (~~[#32]~~ [#343])
A widget to draw freely in 3D. It could be used to draw charts, implement a Paint clone, a CAD application, etc.

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.

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

[#32]: https://github.com/iced-rs/iced/issues/32
[#343] https://github.com/iced-rs/iced/issues/343

### Text shaping and font fallback ([#33])
[`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].
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iced_core"
version = "0.8.0"
version = "0.9.0"
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
edition = "2021"
description = "The essential concepts of Iced"
Expand Down
2 changes: 1 addition & 1 deletion core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This crate is meant to be a starting point for an Iced runtime.
Add `iced_core` as a dependency in your `Cargo.toml`:

```toml
iced_core = "0.8"
iced_core = "0.9"
```

__Iced moves fast and the `master` branch can contain breaking changes!__ If
Expand Down
3 changes: 0 additions & 3 deletions core/src/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ pub enum Alignment {

/// Align at the end of the axis.
End,

/// Fill the entire axis.
Fill,
}

impl From<Horizontal> for Alignment {
Expand Down
9 changes: 2 additions & 7 deletions core/src/font.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/// A font.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Default)]
pub enum Font {
/// The default font.
///
/// This is normally a font configured in a renderer or loaded from the
/// system.
#[default]
Default,

/// An external font.
Expand All @@ -16,9 +17,3 @@ pub enum Font {
bytes: &'static [u8],
},
}

impl Default for Font {
fn default() -> Font {
Font::Default
}
}
2 changes: 1 addition & 1 deletion core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! ![The foundations of the Iced ecosystem](https://github.com/iced-rs/iced/blob/0525d76ff94e828b7b21634fa94a747022001c83/docs/graphs/foundations.png?raw=true)
//!
//! [Iced]: https://github.com/iced-rs/iced
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.8/native
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.9/native
//! [`iced_web`]: https://github.com/iced-rs/iced_web
#![doc(
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
Expand Down
10 changes: 3 additions & 7 deletions core/src/mouse/interaction.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/// The interaction of a mouse cursor.
#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord)]
#[derive(Debug, Eq, PartialEq, Clone, Copy, PartialOrd, Ord, Default)]
#[allow(missing_docs)]
pub enum Interaction {
#[default]
Idle,
Pointer,
Grab,
Expand All @@ -11,10 +12,5 @@ pub enum Interaction {
Grabbing,
ResizingHorizontally,
ResizingVertically,
}

impl Default for Interaction {
fn default() -> Interaction {
Interaction::Idle
}
NotAllowed,
}
10 changes: 6 additions & 4 deletions core/src/padding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ impl Padding {
/// Fits the [`Padding`] between the provided `inner` and `outer` [`Size`].
pub fn fit(self, inner: Size, outer: Size) -> Self {
let available = (outer - inner).max(Size::ZERO);
let new_top = self.top.min(available.height);
let new_left = self.left.min(available.width);

Padding {
top: self.top.min(available.height / 2.0),
right: self.right.min(available.width / 2.0),
bottom: self.bottom.min(available.height / 2.0),
left: self.left.min(available.width / 2.0),
top: new_top,
bottom: self.bottom.min(available.height - new_top),
left: new_left,
right: self.right.min(available.width - new_left),
}
}
}
Expand Down
52 changes: 52 additions & 0 deletions docs/release_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import re
import sys
import requests
from typing import List, Tuple

if len(sys.argv) < 3:
print("Usage: python release_summary.py <personal_access_token> <previous_release_branch>")
exit(1)

TOKEN = sys.argv[1]
HEADERS = {"Authorization": f"Bearer {TOKEN}"}
PR_COMMIT_REGEX = re.compile(r"(?i)Merge pull request #(\d+).*")

def get_merged_prs_since_release(repo: str, previous_release_branch: str) -> List[Tuple[str, int, str, str]]:
prs = []
compare_url = f"https://api.github.com/repos/{repo}/compare/{previous_release_branch}...master"
compare_response = requests.get(compare_url, headers=HEADERS)

if compare_response.status_code == 200:
compare_data = compare_response.json()
for commit in compare_data["commits"]:
match = PR_COMMIT_REGEX.search(commit["commit"]["message"])
if match:
pr_number = int(match.group(1))
pr_url = f"https://api.github.com/repos/{repo}/pulls/{pr_number}"
pr_response = requests.get(pr_url, headers=HEADERS)
if pr_response.status_code == 200:
pr_data = pr_response.json()
prs.append((pr_data["title"], pr_number, pr_data["html_url"], pr_data["user"]["login"]))
else:
print(f"Error fetching PR {pr_number}: {pr_response.status_code}")
else:
print(f"Error comparing branches: {compare_response.status_code}")

return prs

def print_pr_list(prs: List[Tuple[str, int, str, str]]):
for pr in prs:
print(f"- {pr[0]}. [#{pr[1]}]({pr[2]})")

def print_authors(prs: List[Tuple[str, int, str, str]]):
authors = set(pr[3] for pr in prs)
print("\nAuthors:")
for author in sorted(authors, key=str.casefold):
print(f"- @{author}")

if __name__ == "__main__":
repo = "iced-rs/iced"
previous_release_branch = sys.argv[2]
merged_prs = get_merged_prs_since_release(repo, previous_release_branch)
print_pr_list(merged_prs)
print_authors(merged_prs)
2 changes: 1 addition & 1 deletion examples/checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The __[`main`]__ file contains all the code of the example.

You can run it with `cargo run`:
```
cargo run --package pick_list
cargo run --package checkbox
```

[`main`]: src/main.rs
7 changes: 4 additions & 3 deletions examples/component/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ mod numeric_input {
.horizontal_alignment(alignment::Horizontal::Center)
.vertical_alignment(alignment::Vertical::Center),
)
.width(50)
.width(40)
.height(40)
.on_press(on_press)
};

Expand All @@ -140,12 +141,12 @@ mod numeric_input {
.map(u32::to_string)
.as_deref()
.unwrap_or(""),
Event::InputChanged,
)
.on_input(Event::InputChanged)
.padding(10),
button("+", Event::IncrementPressed),
]
.align_items(Alignment::Fill)
.align_items(Alignment::Center)
.spacing(10)
.into()
}
Expand Down

0 comments on commit 9c687fa

Please sign in to comment.