Skip to content

Commit c2a68a9

Browse files
committed
Revert "Merge remote-tracking branch 'upstream/master' into workaround-winit-win32-issues"
This reverts commit ecc6207, reversing changes made to 595a5db.
1 parent ecc6207 commit c2a68a9

91 files changed

Lines changed: 840 additions & 1717 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 4 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -6,128 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88
### Added
9-
- Multi-window support. [#1964](https://github.com/iced-rs/iced/pull/1964)
10-
- `TextEditor` widget (or multi-line text input). [#2123](https://github.com/iced-rs/iced/pull/2123)
11-
- `Shader` widget. [#2085](https://github.com/iced-rs/iced/pull/2085)
12-
- Shadows. [#1882](https://github.com/iced-rs/iced/pull/1882)
13-
- Vectorial text for `Canvas`. [#2204](https://github.com/iced-rs/iced/pull/2204)
14-
- Layout consistency. [#2192](https://github.com/iced-rs/iced/pull/2192)
159
- Explicit text caching. [#2058](https://github.com/iced-rs/iced/pull/2058)
16-
- Gradients in Oklab color space. [#2055](https://github.com/iced-rs/iced/pull/2055)
17-
- `Themer` widget. [#2209](https://github.com/iced-rs/iced/pull/2209)
18-
- `Transform` primitive. [#2120](https://github.com/iced-rs/iced/pull/2120)
19-
- Cut functionality for `TextEditor`. [#2215](https://github.com/iced-rs/iced/pull/2215)
20-
- Disabled support for `Checkbox`. [#2109](https://github.com/iced-rs/iced/pull/2109)
21-
- `skip_taskbar` window setting for Windows. [#2211](https://github.com/iced-rs/iced/pull/2211)
22-
- `fetch_maximized` and `fetch_minimized` window commands. [#2189](https://github.com/iced-rs/iced/pull/2189)
23-
- `text_shaping` method for `Tooltip`. [#2172](https://github.com/iced-rs/iced/pull/2172)
24-
- `hovered` styling for `Svg` widget. [#2163](https://github.com/iced-rs/iced/pull/2163)
25-
- Customizable style for `TextEditor`. [#2159](https://github.com/iced-rs/iced/pull/2159)
26-
- `RawText` variant for `Primitive` in `iced_graphics`. [#2158](https://github.com/iced-rs/iced/pull/2158)
27-
- `Stream` support for `Command`. [#2150](https://github.com/iced-rs/iced/pull/2150)
28-
- Access to bounds/content bounds from a `Scrollable` viewport. [#2072](https://github.com/iced-rs/iced/pull/2072)
29-
- `Frame::scale_nonuniform` method. [#2070](https://github.com/iced-rs/iced/pull/2070)
30-
- `theme::Custom::with_fn` to generate completely custom themes. [#2067](https://github.com/iced-rs/iced/pull/2067)
31-
- `style` attribute for `Font`. [#2041](https://github.com/iced-rs/iced/pull/2041)
32-
- Texture filtering options for `Image`. [#1894](https://github.com/iced-rs/iced/pull/1894)
33-
- `default` and `shift_step` methods for `slider` widgets. [#2100](https://github.com/iced-rs/iced/pull/2100)
34-
- `Custom` variant to `command::Action`. [#2146](https://github.com/iced-rs/iced/pull/2146)
35-
- Mouse movement events for `MouseArea`. [#2147](https://github.com/iced-rs/iced/pull/2147)
10+
- `Theme::Custom::with_fn` for custom extended palette generation. [#2067](https://github.com/iced-rs/iced/pull/2067)
3611

3712
### Changed
38-
- Enable WebGPU backend in `wgpu` by default instead of WebGL. [#2068](https://github.com/iced-rs/iced/pull/2068)
39-
- Update `glyphon` to `0.4`. [#2203](https://github.com/iced-rs/iced/pull/2203)
40-
- Require `Send` on stored pipelines. [#2197](https://github.com/iced-rs/iced/pull/2197)
41-
- Update `wgpu` to `0.19`, `glyphon` to `0.5`, `softbuffer` to `0.4`, `window-clipboard` to `0.4`, and `raw-window-handle` to `0.6`. [#2191](https://github.com/iced-rs/iced/pull/2191)
42-
- Update `winit` to `0.29`. [#2169](https://github.com/iced-rs/iced/pull/2169)
43-
- Provide actual bounds to `Shader` primitives. [#2149](https://github.com/iced-rs/iced/pull/2149)
44-
- Deny warnings in `test` workflow. [#2135](https://github.com/iced-rs/iced/pull/2135)
45-
- Update `wgpu` to `0.18` and `cosmic-text` to `0.10`. [#2122](https://github.com/iced-rs/iced/pull/2122)
46-
- Compute vertex positions in the shader. [#2099](https://github.com/iced-rs/iced/pull/2099)
47-
- Migrate twox-hash -> xxhash-rust and switch to Xxh3 for better performance. [#2080](https://github.com/iced-rs/iced/pull/2080)
48-
- Add `keyboard` subscriptions and rename `subscription::events` to `event::listen`. [#2073](https://github.com/iced-rs/iced/pull/2073)
49-
- Use workspace dependencies and package inheritance. [#2069](https://github.com/iced-rs/iced/pull/2069)
50-
- Update `wgpu` to `0.17`. [#2065](https://github.com/iced-rs/iced/pull/2065)
51-
- Support automatic style type casting for `Button`. [#2046](https://github.com/iced-rs/iced/pull/2046)
52-
- Make `with_clip` and `with_save` in `Frame` able to return the data of the provided closure. [#1994](https://github.com/iced-rs/iced/pull/1994)
53-
- Use `Radians` for angle fields in `Arc` and `arc::Elliptical`. [#2027](https://github.com/iced-rs/iced/pull/2027)
54-
- Assert dimensions of quads are normal in `iced_tiny_skia`. [#2082](https://github.com/iced-rs/iced/pull/2082)
55-
- Remove `position` from `overlay::Element`. [#2226](https://github.com/iced-rs/iced/pull/2226)
13+
- Updated `wgpu` to `0.17`. [#2065](https://github.com/iced-rs/iced/pull/2065)
14+
- Changed `Button::style` to take an `impl Into<...>` for consistency. [#2046](https://github.com/iced-rs/iced/pull/2046)
5615

5716
### Fixed
58-
- Clipping of `TextInput` selection. [#2199](https://github.com/iced-rs/iced/pull/2199)
59-
- `Paragraph::grapheme_position` when ligatures are present. [#2196](https://github.com/iced-rs/iced/pull/2196)
60-
- Docs to include missing feature tags. [#2184](https://github.com/iced-rs/iced/pull/2184)
61-
- `PaneGrid` click interaction on the top edge. [#2168](https://github.com/iced-rs/iced/pull/2168)
62-
- `iced_wgpu` not rendering text in SVGs. [#2161](https://github.com/iced-rs/iced/pull/2161)
63-
- Text clipping. [#2154](https://github.com/iced-rs/iced/pull/2154)
64-
- Layout invalidation when `Tooltip` changes `overlay`. [#2143](https://github.com/iced-rs/iced/pull/2143)
65-
- `Overlay` composition. [#2142](https://github.com/iced-rs/iced/pull/2142)
66-
- Incorrect GIF for the `progress_bar` example. [#2141](https://github.com/iced-rs/iced/pull/2141)
67-
- Standalone compilation of `iced_renderer` crate. [#2134](https://github.com/iced-rs/iced/pull/2134)
68-
- Maximize window button enabled when `Settings::resizable` is `false`. [#2124](https://github.com/iced-rs/iced/pull/2124)
69-
- Width of horizontal scrollbar in `Scrollable`. [#2084](https://github.com/iced-rs/iced/pull/2084)
70-
- `ComboBox` widget panic on wasm. [#2078](https://github.com/iced-rs/iced/pull/2078)
71-
- Majority of unresolved documentation links. [#2077](https://github.com/iced-rs/iced/pull/2077)
72-
- Web examples not running. [#2076](https://github.com/iced-rs/iced/pull/2076)
73-
- GIFs and video examples broken. [#2074](https://github.com/iced-rs/iced/pull/2074)
74-
- `@interpolate(flat)` not used as attribute. [#2071](https://github.com/iced-rs/iced/pull/2071)
75-
- `Checkbox` and `Toggler` hidden behind scrollbar in `styling` example. [#2062](https://github.com/iced-rs/iced/pull/2062)
76-
- Absolute `LineHeight` sometimes being `0`. [#2059](https://github.com/iced-rs/iced/pull/2059)
77-
- Paste while holding ALT. [#2006](https://github.com/iced-rs/iced/pull/2006)
78-
- `Command<T>::perform` to return a `Command<T>`. [#2000](https://github.com/iced-rs/iced/pull/2000)
79-
- `convert_text` not called on `Svg` trees. [#1908](https://github.com/iced-rs/iced/pull/1908)
80-
- Unused `backend.rs` file in renderer crate. [#2182](https://github.com/iced-rs/iced/pull/2182)
81-
- Some `clippy::pedantic` lints. [#2096](https://github.com/iced-rs/iced/pull/2096)
82-
- Some minor clippy fixes. [#2092](https://github.com/iced-rs/iced/pull/2092)
83-
- Clippy docs keyword quoting. [#2091](https://github.com/iced-rs/iced/pull/2091)
84-
- Clippy map transformations. [#2090](https://github.com/iced-rs/iced/pull/2090)
85-
- Inline format args for ease of reading. [#2089](https://github.com/iced-rs/iced/pull/2089)
86-
- Stuck scrolling in `Scrollable` with touch events. [#1940](https://github.com/iced-rs/iced/pull/1940)
87-
- Incorrect unit in `system::Information`. [#2223](https://github.com/iced-rs/iced/pull/2223)
88-
- `size_hint` not being called from `element::Map`. [#2224](https://github.com/iced-rs/iced/pull/2224)
89-
- `size_hint` not being called from `element::Explain`. [#2225](https://github.com/iced-rs/iced/pull/2225)
90-
- Slow touch scrolling for `TextEditor` widget. [#2140](https://github.com/iced-rs/iced/pull/2140)
17+
- Missing `width` attribute in `styling` example. [#2062](https://github.com/iced-rs/iced/pull/2062)
9118

9219
Many thanks to...
9320

9421
- @akshayr-mecha
95-
- @alec-deason
96-
- @arslee07
97-
- @AustinMReppert
98-
- @avsaase
99-
- @blazra
100-
- @brianch
101-
- @bungoboingo
102-
- @Calastrophe
103-
- @casperstorm
104-
- @cfrenette
105-
- @Davidster
106-
- @Decodetalkers
107-
- @derezzedex
10822
- @dtzxporter
109-
- @GyulyVGC
110-
- @hicaru
111-
- @ids1024
112-
- @Imberflur
113-
- @jhannyj
114-
- @jhff
115-
- @jim-ec
116-
- @joshuamegnauth54
117-
- @jpttrssn
118-
- @lufte
119-
- @matze
120-
- @MichalLebeda
121-
- @MrAntix
122-
- @nicksenger
123-
- @Nisatru
124-
- @nyurik
125-
- @Remmirad
126-
- @ripytide
127-
- @Tahinli
128-
- @tarkah
129-
- @tzemanovic
130-
- @william-shere
13123

13224
## [0.10.0] - 2023-07-28
13325
### Added

core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ keywords.workspace = true
1212

1313
[dependencies]
1414
bitflags.workspace = true
15-
glam.workspace = true
1615
log.workspace = true
1716
num-traits.workspace = true
1817
smol_str.workspace = true

core/src/angle.rs

Lines changed: 14 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{Point, Rectangle, Vector};
22

33
use std::f32::consts::{FRAC_PI_2, PI};
4-
use std::ops::{Add, AddAssign, Div, Mul, RangeInclusive, Sub, SubAssign};
4+
use std::ops::RangeInclusive;
55

66
/// Degrees
77
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
@@ -13,26 +13,7 @@ pub struct Radians(pub f32);
1313

1414
impl Radians {
1515
/// The range of radians of a circle.
16-
pub const RANGE: RangeInclusive<Self> = Self(0.0)..=Self(2.0 * PI);
17-
18-
/// The amount of radians in half a circle.
19-
pub const PI: Self = Self(PI);
20-
21-
/// Calculates the line in which the angle intercepts the `bounds`.
22-
pub fn to_distance(&self, bounds: &Rectangle) -> (Point, Point) {
23-
let angle = self.0 - FRAC_PI_2;
24-
let r = Vector::new(f32::cos(angle), f32::sin(angle));
25-
26-
let distance_to_rect = f32::max(
27-
f32::abs(r.x * bounds.width / 2.0),
28-
f32::abs(r.y * bounds.height / 2.0),
29-
);
30-
31-
let start = bounds.center() - r * distance_to_rect;
32-
let end = bounds.center() + r * distance_to_rect;
33-
34-
(start, end)
35-
}
16+
pub const RANGE: RangeInclusive<Radians> = Radians(0.0)..=Radians(2.0 * PI);
3617
}
3718

3819
impl From<Degrees> for Radians {
@@ -73,70 +54,20 @@ impl num_traits::FromPrimitive for Radians {
7354
}
7455
}
7556

76-
impl Sub for Radians {
77-
type Output = Self;
78-
79-
fn sub(self, rhs: Self) -> Self::Output {
80-
Self(self.0 - rhs.0)
81-
}
82-
}
83-
84-
impl SubAssign for Radians {
85-
fn sub_assign(&mut self, rhs: Self) {
86-
self.0 = self.0 - rhs.0;
87-
}
88-
}
89-
90-
impl Add for Radians {
91-
type Output = Self;
92-
93-
fn add(self, rhs: Self) -> Self::Output {
94-
Self(self.0 + rhs.0)
95-
}
96-
}
97-
98-
impl AddAssign for Radians {
99-
fn add_assign(&mut self, rhs: Radians) {
100-
self.0 = self.0 + rhs.0;
101-
}
102-
}
103-
104-
impl Mul for Radians {
105-
type Output = Self;
106-
107-
fn mul(self, rhs: Radians) -> Self::Output {
108-
Radians(self.0 * rhs.0)
109-
}
110-
}
111-
112-
impl Mul<f32> for Radians {
113-
type Output = Self;
114-
115-
fn mul(self, rhs: f32) -> Self::Output {
116-
Self(self.0 * rhs)
117-
}
118-
}
119-
120-
impl Mul<Radians> for f32 {
121-
type Output = Radians;
122-
123-
fn mul(self, rhs: Radians) -> Self::Output {
124-
Radians(self * rhs.0)
125-
}
126-
}
127-
128-
impl Div<f32> for Radians {
129-
type Output = Self;
57+
impl Radians {
58+
/// Calculates the line in which the angle intercepts the `bounds`.
59+
pub fn to_distance(&self, bounds: &Rectangle) -> (Point, Point) {
60+
let angle = self.0 - FRAC_PI_2;
61+
let r = Vector::new(f32::cos(angle), f32::sin(angle));
13062

131-
fn div(self, rhs: f32) -> Self::Output {
132-
Radians(self.0 / rhs)
133-
}
134-
}
63+
let distance_to_rect = f32::max(
64+
f32::abs(r.x * bounds.width / 2.0),
65+
f32::abs(r.y * bounds.height / 2.0),
66+
);
13567

136-
impl Div for Radians {
137-
type Output = Self;
68+
let start = bounds.center() - r * distance_to_rect;
69+
let end = bounds.center() + r * distance_to_rect;
13870

139-
fn div(self, rhs: Self) -> Self::Output {
140-
Self(self.0 / rhs.0)
71+
(start, end)
14172
}
14273
}

core/src/element.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,6 @@ where
308308
self.widget.size()
309309
}
310310

311-
fn size_hint(&self) -> Size<Length> {
312-
self.widget.size_hint()
313-
}
314-
315311
fn layout(
316312
&self,
317313
tree: &mut Tree,
@@ -446,12 +442,11 @@ where
446442
tree: &'b mut Tree,
447443
layout: Layout<'_>,
448444
renderer: &Renderer,
449-
translation: Vector,
450445
) -> Option<overlay::Element<'b, B, Theme, Renderer>> {
451446
let mapper = &self.mapper;
452447

453448
self.widget
454-
.overlay(tree, layout, renderer, translation)
449+
.overlay(tree, layout, renderer)
455450
.map(move |overlay| overlay.map(mapper))
456451
}
457452
}
@@ -482,10 +477,6 @@ where
482477
self.element.widget.size()
483478
}
484479

485-
fn size_hint(&self) -> Size<Length> {
486-
self.element.widget.size_hint()
487-
}
488-
489480
fn tag(&self) -> tree::Tag {
490481
self.element.widget.tag()
491482
}
@@ -597,10 +588,7 @@ where
597588
state: &'b mut Tree,
598589
layout: Layout<'_>,
599590
renderer: &Renderer,
600-
translation: Vector,
601591
) -> Option<overlay::Element<'b, Message, Theme, Renderer>> {
602-
self.element
603-
.widget
604-
.overlay(state, layout, renderer, translation)
592+
self.element.widget.overlay(state, layout, renderer)
605593
}
606594
}

core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ mod rectangle;
4949
mod shadow;
5050
mod shell;
5151
mod size;
52-
mod transformation;
5352
mod vector;
5453

5554
pub use alignment::Alignment;
@@ -76,7 +75,6 @@ pub use shadow::Shadow;
7675
pub use shell::Shell;
7776
pub use size::Size;
7877
pub use text::Text;
79-
pub use transformation::Transformation;
8078
pub use vector::Vector;
8179
pub use widget::Widget;
8280

core/src/mouse/interaction.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ pub enum Interaction {
1313
ResizingHorizontally,
1414
ResizingVertically,
1515
NotAllowed,
16-
ZoomIn,
1716
}

core/src/overlay.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ where
2424
/// user interface.
2525
///
2626
/// [`Node`]: layout::Node
27-
fn layout(&mut self, renderer: &Renderer, bounds: Size) -> layout::Node;
27+
fn layout(
28+
&mut self,
29+
renderer: &Renderer,
30+
bounds: Size,
31+
position: Point,
32+
translation: Vector,
33+
) -> layout::Node;
2834

2935
/// Draws the [`Overlay`] using the associated `Renderer`.
3036
fn draw(
@@ -114,7 +120,6 @@ pub fn from_children<'a, Message, Theme, Renderer>(
114120
tree: &'a mut Tree,
115121
layout: Layout<'_>,
116122
renderer: &Renderer,
117-
translation: Vector,
118123
) -> Option<Element<'a, Message, Theme, Renderer>>
119124
where
120125
Renderer: crate::Renderer,
@@ -124,9 +129,7 @@ where
124129
.zip(&mut tree.children)
125130
.zip(layout.children())
126131
.filter_map(|((child, state), layout)| {
127-
child
128-
.as_widget_mut()
129-
.overlay(state, layout, renderer, translation)
132+
child.as_widget_mut().overlay(state, layout, renderer)
130133
})
131134
.collect::<Vec<_>>();
132135

0 commit comments

Comments
 (0)