From 8f0839e786f8d521f7319dd0e188d43284f526b7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 9 Feb 2022 19:42:15 +0700 Subject: Draft `iced_virtual` subcrate The idea here is to expose a set of "virtual widgets" that can be used with a `Virtual` widget and its `virtual::State`. A virtual widget is a widget that does not contain any state, but instead is a "virtual" representation of the "real" widget. The real widgets are stored in the `virtual::State`. Every time a new virtual widget tree is created during `view`, it is compared to the previous one and "real" widgets are added / removed to the `virtual::State`. Effectively, this removes the need to keep track of local widget state in the application state and allows `view` to take an immutable reference to `self`. To summarize, using this crate should allow users to remove `State` structs in their application state. Eventually, the strategy used here may be adopted generally and, as a result, all of the widgets in `iced_native` would be replaced! --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 7c222fbb..7a4cecc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,6 +58,7 @@ members = [ "lazy", "native", "style", + "virtual", "wgpu", "winit", "examples/bezier_tool", -- cgit From 5225e0e304bf5b407977e549c48ce9dea26b8c40 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 10 Feb 2022 21:54:13 +0700 Subject: Draft virtual `Button`, `Column`, and `Text` ... as well as a very naive diffing strategy! --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 7a4cecc8..1d4eb883 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,6 +88,7 @@ members = [ "examples/tooltip", "examples/tour", "examples/url_handler", + "examples/virtual_counter", "examples/websocket", ] -- cgit From 897188317b5875cc00a0f1c797790df8ac13687f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 11 Feb 2022 17:50:12 +0700 Subject: Rename `iced_virtual` to `iced_pure` `virtual` is a reserved keyword in Rust :grimacing: --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 1d4eb883..1918d8b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,8 +57,8 @@ members = [ "glutin", "lazy", "native", + "pure", "style", - "virtual", "wgpu", "winit", "examples/bezier_tool", @@ -88,7 +88,7 @@ members = [ "examples/tooltip", "examples/tour", "examples/url_handler", - "examples/virtual_counter", + "examples/pure/counter", "examples/websocket", ] -- cgit From 66d69b5c9a183091e05e82bbe21b3203f75c1b18 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 11 Feb 2022 17:51:33 +0700 Subject: Expose `iced_pure` through a `pure` feature in `iced` Besides exposing the `iced_pure` crate, enabling the `pure` feature also provides pure versions of both the `Application` and `Sandbox` traits! :tada: --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 1918d8b4..1527c373 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,8 @@ async-std = ["iced_futures/async-std"] smol = ["iced_futures/smol"] # Enables advanced color conversion via `palette` palette = ["iced_core/palette"] +# Enables pure, virtual widgets in the `pure` module +pure = ["iced_pure"] [badges] maintenance = { status = "actively-developed" } @@ -98,6 +100,7 @@ iced_futures = { version = "0.3", path = "futures" } iced_winit = { version = "0.3", path = "winit" } iced_glutin = { version = "0.2", path = "glutin", optional = true } iced_glow = { version = "0.2", path = "glow", optional = true } +iced_pure = { version = "0.1", path = "pure", optional = true } thiserror = "1.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -- cgit From bd22cc0bc0f7551d29cf2acd22520f4a906f253c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 12 Feb 2022 17:21:28 +0700 Subject: Implement pure version of `todos` example :tada: The `Widget` trait in `iced_pure` needed to change a bit to make the implementation of `Element::map` possible. Specifically, the `children` method has been split into `diff` and `children_state`. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 1527c373..11966dd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,6 +91,7 @@ members = [ "examples/tour", "examples/url_handler", "examples/pure/counter", + "examples/pure/todos", "examples/websocket", ] -- cgit From cff891833be68c0e2d4919d4475daf23da821f9b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 13 Feb 2022 22:19:43 +0700 Subject: Implement `pure` version of the `tour` example :tada: --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 11966dd0..9adb2ae5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,6 +92,7 @@ members = [ "examples/url_handler", "examples/pure/counter", "examples/pure/todos", + "examples/pure/tour", "examples/websocket", ] -- cgit From 2737b21d346c9034502c345dea735ca136b49cea Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 16 Feb 2022 17:16:34 +0700 Subject: Implement `pure` version of `pick_list` example :tada: --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 9adb2ae5..e94a1652 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,6 +91,7 @@ members = [ "examples/tour", "examples/url_handler", "examples/pure/counter", + "examples/pure/pick_list", "examples/pure/todos", "examples/pure/tour", "examples/websocket", -- cgit From 9b23ea698e98f5731a1253410e23697329083c78 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 17 Feb 2022 19:09:26 +0700 Subject: Implement `pure` version of `component` example --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index e94a1652..aa4bbacd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,6 +90,7 @@ members = [ "examples/tooltip", "examples/tour", "examples/url_handler", + "examples/pure/component", "examples/pure/counter", "examples/pure/pick_list", "examples/pure/todos", -- cgit From 12c1a3f829c801022d45f1a294d8fc7fa10606e5 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 9 Mar 2022 14:10:15 +0700 Subject: Remove redundant `widget` modules in subcrates Instead, we can define the type aliases just once in the root crate! --- Cargo.toml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index aa4bbacd..74123046 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,24 +14,20 @@ resolver = "2" [features] default = ["wgpu"] -# Enables the `iced_wgpu` renderer -wgpu = ["iced_wgpu"] # Enables the `Image` widget image = ["iced_wgpu/image"] # Enables the `Svg` widget svg = ["iced_wgpu/svg"] # Enables the `Canvas` widget -canvas = ["iced_wgpu/canvas"] +canvas = ["iced_graphics/canvas"] # Enables the `QRCode` widget -qr_code = ["iced_wgpu/qr_code"] +qr_code = ["iced_graphics/qr_code"] +# Enables the `iced_wgpu` renderer +wgpu = ["iced_wgpu"] # Enables using system fonts default_system_font = ["iced_wgpu/default_system_font"] # Enables the `iced_glow` renderer. Overrides `iced_wgpu` glow = ["iced_glow", "iced_glutin"] -# Enables the `Canvas` widget for `iced_glow` -glow_canvas = ["iced_glow/canvas"] -# Enables the `QRCode` widget for `iced_glow` -glow_qr_code = ["iced_glow/qr_code"] # Enables using system fonts for `iced_glow` glow_default_system_font = ["iced_glow/default_system_font"] # Enables a debug view in native platforms (press F12) @@ -101,6 +97,8 @@ members = [ [dependencies] iced_core = { version = "0.4", path = "core" } iced_futures = { version = "0.3", path = "futures" } +iced_native = { version = "0.4", path = "native" } +iced_graphics = { version = "0.2", path = "graphics" } iced_winit = { version = "0.3", path = "winit" } iced_glutin = { version = "0.2", path = "glutin", optional = true } iced_glow = { version = "0.2", path = "glow", optional = true } -- cgit From 0cddb3c1b55017cda29d32924514e917a389f11b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 9 Mar 2022 18:59:40 +0700 Subject: Implement `pure` version of `Canvas` widget --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 74123046..f36f74f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ smol = ["iced_futures/smol"] # Enables advanced color conversion via `palette` palette = ["iced_core/palette"] # Enables pure, virtual widgets in the `pure` module -pure = ["iced_pure"] +pure = ["iced_pure", "iced_graphics/pure"] [badges] maintenance = { status = "actively-developed" } -- cgit From 7d7064a44dcda8251bd5ef53765ba025159a0bba Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 9 Mar 2022 19:09:40 +0700 Subject: Implement `pure` version of `game_of_life` example :tada: --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index f36f74f0..15a4801d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,6 +88,7 @@ members = [ "examples/url_handler", "examples/pure/component", "examples/pure/counter", + "examples/pure/game_of_life", "examples/pure/pick_list", "examples/pure/todos", "examples/pure/tour", -- cgit From 6dd187ff0822230f084e43636b1aabeb1baf06f6 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 10 Mar 2022 19:25:57 +0700 Subject: Implement `pure` version of `PaneGrid` widget --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 15a4801d..c6ccc5df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,6 +89,7 @@ members = [ "examples/pure/component", "examples/pure/counter", "examples/pure/game_of_life", + "examples/pure/pane_grid", "examples/pure/pick_list", "examples/pure/todos", "examples/pure/tour", -- cgit