Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1db675

Browse files
committed
Merge branch 'master' into 0.8
2 parentsfbca18d +0d16569 commitf1db675

File tree

132 files changed

+2186
-850
lines changed

Some content is hidden

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

132 files changed

+2186
-850
lines changed

‎CHANGELOG.md

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

77
##[Unreleased]
88

9+
##[0.8.0] - 2023-02-18
10+
###Added
11+
- Generic pixel units.[#1711](https://github.com/iced-rs/iced/pull/1711)
12+
-`custom` method to`widget::Operation` trait.[#1649](https://github.com/iced-rs/iced/pull/1649)
13+
-`Group` overlay.[#1655](https://github.com/iced-rs/iced/pull/1655)
14+
- Standalone`draw` helper for`image`.[#1682](https://github.com/iced-rs/iced/pull/1682)
15+
- Dynamic`pick_list::Handle`.[#1675](https://github.com/iced-rs/iced/pull/1675)
16+
-`Id` support for`Container`.[#1695](https://github.com/iced-rs/iced/pull/1695)
17+
- Custom`Checkbox` icon support.[#1707](https://github.com/iced-rs/iced/pull/1707)
18+
-`window` action to change always on top setting.[#1587](https://github.com/iced-rs/iced/pull/1587)
19+
-`window` action to fetch its unique identifier.[#1589](https://github.com/iced-rs/iced/pull/1589)
20+
21+
###Changed
22+
- Annotated`Command` and`Subscription` with`#[must_use]`.[#1676](https://github.com/iced-rs/iced/pull/1676)
23+
- Replaced`Fn` with`FnOnce` in`canvas::Cache::draw`.[#1694](https://github.com/iced-rs/iced/pull/1694)
24+
- Used`[default]` on enum in`game_of_life` example.[#1660](https://github.com/iced-rs/iced/pull/1660)
25+
- Made`QRCode` hide when data is empty in`qr_code` example.[#1665](https://github.com/iced-rs/iced/pull/1665)
26+
- Replaced`Cow` with`Bytes` in`image` to accept any kind of data that implements`AsRef<[u8]>`.[#1551](https://github.com/iced-rs/iced/pull/1551)
27+
28+
###Fixed
29+
- Blank window on application startup.[#1698](https://github.com/iced-rs/iced/pull/1698)
30+
- Off-by-one pixel error on`pick_list` width.[#1679](https://github.com/iced-rs/iced/pull/1679)
31+
- Missing`text_input` implementation in`operation::Map`.[#1678](https://github.com/iced-rs/iced/pull/1678)
32+
- Widget-driven animations for`Component`.[#1685](https://github.com/iced-rs/iced/pull/1685)
33+
- Layout translation in`overlay::Group`.[#1686](https://github.com/iced-rs/iced/pull/1686)
34+
- Missing`is_over` implementation for overlays of`iced_lazy` widgets.[#1699](https://github.com/iced-rs/iced/pull/1699)
35+
- Panic when overlay event processing removes overlay.[#1700](https://github.com/iced-rs/iced/pull/1700)
36+
- Panic when using operations with components in certain cases.[#1701](https://github.com/iced-rs/iced/pull/1701)
37+
-`TextInput` width when using padding.[#1706](https://github.com/iced-rs/iced/pull/1706)
38+
-`iced_glow` crash on some hardware.[#1703](https://github.com/iced-rs/iced/pull/1703)
39+
- Height of`overlay::Menu`.[#1714](https://github.com/iced-rs/iced/pull/1714)
40+
- Size of images in`README`.[#1659](https://github.com/iced-rs/iced/pull/1659)
41+
- New`clippy` lints.[#1681](https://github.com/iced-rs/iced/pull/1681)
42+
43+
Many thanks to...
44+
45+
-@13r0ck
46+
-@bungoboingo
47+
-@casperstorm
48+
-@frey
49+
-@greatest-ape
50+
-@ids1024
51+
-@Jedsek
52+
-@nicksenger
53+
-@Night-Hunter-NF
54+
-@sdroege
55+
-@Sn-Kinos
56+
-@sushigiri
57+
-@tarkah
58+
959
##[0.7.0] - 2023-01-14
1060
###Added
1161
- Widget-driven animations.[#1647](https://github.com/iced-rs/iced/pull/1647)
@@ -364,7 +414,8 @@ Many thanks to...
364414
###Added
365415
- First release!:tada:
366416

367-
[Unreleased]:https://github.com/iced-rs/iced/compare/0.7.0...HEAD
417+
[Unreleased]:https://github.com/iced-rs/iced/compare/0.8.0...HEAD
418+
[0.8.0]:https://github.com/iced-rs/iced/compare/0.7.0...0.8.0
368419
[0.7.0]:https://github.com/iced-rs/iced/compare/0.6.0...0.7.0
369420
[0.6.0]:https://github.com/iced-rs/iced/compare/0.5.0...0.6.0
370421
[0.5.0]:https://github.com/iced-rs/iced/compare/0.4.2...0.5.0

‎Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name ="iced"
3-
version ="0.7.0"
3+
version ="0.8.0"
44
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
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.7",path ="core" }
70-
iced_futures = {version ="0.5",path ="futures" }
71-
iced_native = {version ="0.8",path ="native" }
72-
iced_graphics = {version ="0.6",path ="graphics" }
73-
iced_winit = {version ="0.7",path ="winit",features = ["application"] }
74-
iced_glutin = {version ="0.6",path ="glutin",optional =true }
75-
iced_glow = {version ="0.6",path ="glow",optional =true }
69+
iced_core = {version ="0.8",path ="core" }
70+
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 }
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.8",path ="wgpu",optional =true }
84+
iced_wgpu = {version ="0.9",path ="wgpu",optional =true }
8585

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

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

‎README.md

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

1717
<ahref="https://gfycat.com/littlesanehalicore">
18-
<imgsrc="https://thumbs.gfycat.com/LittleSaneHalicore-small.gif"height="350px">
18+
<imgsrc="https://thumbs.gfycat.com/LittleSaneHalicore-small.gif"width="275px">
1919
</a>
2020
<ahref="https://gfycat.com/politeadorableiberianmole">
21-
<imgsrc="https://thumbs.gfycat.com/PoliteAdorableIberianmole-small.gif"height="350px">
21+
<imgsrc="https://thumbs.gfycat.com/PoliteAdorableIberianmole-small.gif"width="273px">
2222
</a>
2323

2424
</div>
@@ -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.7"
71+
iced ="0.8"
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.7",default-features =false,features = ["glow"] }
218+
iced = {version ="0.8",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,

‎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.7.0"
3+
version ="0.8.0"
44
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
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.7"
21+
iced_core ="0.8"
2222
```
2323

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

‎core/src/length.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The strategy used to fill space in a specific dimension.
2-
#[derive(Debug,Clone,Copy,PartialEq,Eq,Hash)]
2+
#[derive(Debug,Clone,Copy,PartialEq)]
33
pubenumLength{
44
/// Fill all the remaining space
55
Fill,
@@ -17,7 +17,7 @@ pub enum Length {
1717
Shrink,
1818

1919
/// Fill a fixed amount of space
20-
Units(u16),
20+
Fixed(f32),
2121
}
2222

2323
implLength{
@@ -31,13 +31,19 @@ impl Length {
3131
Length::Fill =>1,
3232
Length::FillPortion(factor) =>*factor,
3333
Length::Shrink =>0,
34-
Length::Units(_) =>0,
34+
Length::Fixed(_) =>0,
3535
}
3636
}
3737
}
3838

39+
implFrom<f32>forLength{
40+
fnfrom(amount:f32) ->Self{
41+
Length::Fixed(amount)
42+
}
43+
}
44+
3945
implFrom<u16>forLength{
4046
fnfrom(units:u16) ->Self{
41-
Length::Units(units)
47+
Length::Fixed(f32::from(units))
4248
}
4349
}

‎core/src/lib.rs

Lines changed: 3 additions & 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.7/native
10+
//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.8/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"
@@ -35,6 +35,7 @@ mod content_fit;
3535
mod font;
3636
mod length;
3737
mod padding;
38+
mod pixels;
3839
mod point;
3940
mod rectangle;
4041
mod size;
@@ -47,6 +48,7 @@ pub use content_fit::ContentFit;
4748
pubuse font::Font;
4849
pubuse length::Length;
4950
pubuse padding::Padding;
51+
pubuse pixels::Pixels;
5052
pubuse point::Point;
5153
pubuse rectangle::Rectangle;
5254
pubuse size::Size;

‎core/src/padding.rs

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,29 @@ use crate::Size;
3333
/// let widget = Widget::new().padding([10, 20]); // top/bottom, left/right
3434
/// let widget = Widget::new().padding([5, 10, 15, 20]); // top, right, bottom, left
3535
/// ```
36-
#[derive(Debug,Hash,Copy,Clone)]
36+
#[derive(Debug,Copy,Clone)]
3737
pubstructPadding{
3838
/// Top padding
39-
pubtop:u16,
39+
pubtop:f32,
4040
/// Right padding
41-
pubright:u16,
41+
pubright:f32,
4242
/// Bottom padding
43-
pubbottom:u16,
43+
pubbottom:f32,
4444
/// Left padding
45-
publeft:u16,
45+
publeft:f32,
4646
}
4747

4848
implPadding{
4949
/// Padding of zero
5050
pubconstZERO:Padding =Padding{
51-
top:0,
52-
right:0,
53-
bottom:0,
54-
left:0,
51+
top:0.0,
52+
right:0.0,
53+
bottom:0.0,
54+
left:0.0,
5555
};
5656

5757
/// Create a Padding that is equal on all sides
58-
pubconstfnnew(padding:u16) ->Padding{
58+
pubconstfnnew(padding:f32) ->Padding{
5959
Padding{
6060
top: padding,
6161
right: padding,
@@ -65,12 +65,12 @@ impl Padding {
6565
}
6666

6767
/// Returns the total amount of vertical [`Padding`].
68-
pubfnvertical(self) ->u16{
68+
pubfnvertical(self) ->f32{
6969
self.top +self.bottom
7070
}
7171

7272
/// Returns the total amount of horizontal [`Padding`].
73-
pubfnhorizontal(self) ->u16{
73+
pubfnhorizontal(self) ->f32{
7474
self.left +self.right
7575
}
7676

@@ -79,16 +79,49 @@ impl Padding {
7979
let available =(outer - inner).max(Size::ZERO);
8080

8181
Padding{
82-
top:self.top.min((available.heightasu16)/2),
83-
right:self.right.min((available.widthasu16)/2),
84-
bottom:self.bottom.min((available.heightasu16)/2),
85-
left:self.left.min((available.widthasu16)/2),
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),
8686
}
8787
}
8888
}
8989

9090
implFrom<u16>forPadding{
9191
fnfrom(p:u16) ->Self{
92+
Padding{
93+
top: f32::from(p),
94+
right: f32::from(p),
95+
bottom: f32::from(p),
96+
left: f32::from(p),
97+
}
98+
}
99+
}
100+
101+
implFrom<[u16;2]>forPadding{
102+
fnfrom(p:[u16;2]) ->Self{
103+
Padding{
104+
top: f32::from(p[0]),
105+
right: f32::from(p[1]),
106+
bottom: f32::from(p[0]),
107+
left: f32::from(p[1]),
108+
}
109+
}
110+
}
111+
112+
implFrom<[u16;4]>forPadding{
113+
fnfrom(p:[u16;4]) ->Self{
114+
Padding{
115+
top: f32::from(p[0]),
116+
right: f32::from(p[1]),
117+
bottom: f32::from(p[2]),
118+
left: f32::from(p[3]),
119+
}
120+
}
121+
}
122+
123+
implFrom<f32>forPadding{
124+
fnfrom(p:f32) ->Self{
92125
Padding{
93126
top: p,
94127
right: p,
@@ -98,8 +131,8 @@ impl From<u16> for Padding {
98131
}
99132
}
100133

101-
implFrom<[u16;2]>forPadding{
102-
fnfrom(p:[u16;2]) ->Self{
134+
implFrom<[f32;2]>forPadding{
135+
fnfrom(p:[f32;2]) ->Self{
103136
Padding{
104137
top: p[0],
105138
right: p[1],
@@ -109,8 +142,8 @@ impl From<[u16; 2]> for Padding {
109142
}
110143
}
111144

112-
implFrom<[u16;4]>forPadding{
113-
fnfrom(p:[u16;4]) ->Self{
145+
implFrom<[f32;4]>forPadding{
146+
fnfrom(p:[f32;4]) ->Self{
114147
Padding{
115148
top: p[0],
116149
right: p[1],

‎core/src/pixels.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// An amount of logical pixels.
2+
///
3+
/// Normally used to represent an amount of space, or the size of something.
4+
///
5+
/// This type is normally asked as an argument in a generic way
6+
/// (e.g. `impl Into<Pixels>`) and, since `Pixels` implements `From` both for
7+
/// `f32` and `u16`, you should be able to provide both integers and float
8+
/// literals as needed.
9+
#[derive(Debug,Clone,Copy,PartialEq,PartialOrd)]
10+
pubstructPixels(pubf32);
11+
12+
implFrom<f32>forPixels{
13+
fnfrom(amount:f32) ->Self{
14+
Self(amount)
15+
}
16+
}
17+
18+
implFrom<u16>forPixels{
19+
fnfrom(amount:u16) ->Self{
20+
Self(f32::from(amount))
21+
}
22+
}

‎core/src/size.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ impl Size {
2929
/// Increments the [`Size`] to account for the given padding.
3030
pubfnpad(&self,padding:Padding) ->Self{
3131
Size{
32-
width:self.width + padding.horizontal()asf32,
33-
height:self.height + padding.vertical()asf32,
32+
width:self.width + padding.horizontal(),
33+
height:self.height + padding.vertical(),
3434
}
3535
}
3636

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp