From 7d2d813343baae10c2667590463385d50abb784c Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 16:57:24 +0100 Subject: [PATCH 001/440] added new style for scrollable, to be applied when mouse is over the scrollable area --- native/src/widget/scrollable.rs | 4 ++++ style/src/scrollable.rs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 82286036..de6eacb5 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -856,6 +856,8 @@ pub fn draw( theme.dragging(style) } else if mouse_over_y_scrollbar { theme.hovered(style) + } else if mouse_over_scrollable { + theme.focused(style) } else { theme.active(style) }; @@ -869,6 +871,8 @@ pub fn draw( theme.dragging_horizontal(style) } else if mouse_over_x_scrollbar { theme.hovered_horizontal(style) + } else if mouse_over_scrollable { + theme.focused_horizontal(style) } else { theme.active_horizontal(style) }; diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs index 64ed8462..a3f3db20 100644 --- a/style/src/scrollable.rs +++ b/style/src/scrollable.rs @@ -45,6 +45,11 @@ pub trait StyleSheet { self.hovered(style) } + /// Produces the style of a scrollbar when mouse is over the scrollable area. + fn focused(&self, style: &Self::Style) -> Scrollbar { + self.active(style) + } + /// Produces the style of an active horizontal scrollbar. fn active_horizontal(&self, style: &Self::Style) -> Scrollbar { self.active(style) @@ -59,4 +64,9 @@ pub trait StyleSheet { fn dragging_horizontal(&self, style: &Self::Style) -> Scrollbar { self.hovered_horizontal(style) } + + /// Produces the style of a horizontal scrollbar when mouse is over the scrollable area. + fn focused_horizontal(&self, style: &Self::Style) -> Scrollbar { + self.active_horizontal(style) + } } From eaa2238600a0d3055b379592c7a3f8e6453b9dc7 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 17:32:08 +0100 Subject: [PATCH 002/440] debugging focused style not working --- native/src/widget/scrollable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index de6eacb5..71814034 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -859,7 +859,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused(style) } else { - theme.active(style) + theme.focused(style) }; draw_scrollbar(renderer, style, &scrollbar); @@ -874,7 +874,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused_horizontal(style) } else { - theme.active_horizontal(style) + theme.focused_horizontal(style) }; draw_scrollbar(renderer, style, &scrollbar); From 49e9a9a5379c1e9a9469045ca9a51ffb860ee620 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 17:56:39 +0100 Subject: [PATCH 003/440] added function focused and focused_horizontal to theme.rs --- native/src/widget/scrollable.rs | 4 ++-- style/src/theme.rs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 71814034..de6eacb5 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -859,7 +859,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused(style) } else { - theme.focused(style) + theme.active(style) }; draw_scrollbar(renderer, style, &scrollbar); @@ -874,7 +874,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused_horizontal(style) } else { - theme.focused_horizontal(style) + theme.active_horizontal(style) }; draw_scrollbar(renderer, style, &scrollbar); diff --git a/style/src/theme.rs b/style/src/theme.rs index 55bfa4ca..8d40bda1 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -935,6 +935,13 @@ impl scrollable::StyleSheet for Theme { } } + fn focused(&self, style: &Self::Style) -> scrollable::Scrollbar { + match style { + Scrollable::Default => self.active(style), + Scrollable::Custom(custom) => custom.focused(self), + } + } + fn active_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { Scrollable::Default => self.active(style), @@ -958,6 +965,16 @@ impl scrollable::StyleSheet for Theme { Scrollable::Custom(custom) => custom.dragging_horizontal(self), } } + + fn focused_horizontal( + &self, + style: &Self::Style, + ) -> scrollable::Scrollbar { + match style { + Scrollable::Default => self.active_horizontal(style), + Scrollable::Custom(custom) => custom.focused_horizontal(self), + } + } } /// The style of text. From b9a9576207ddfc7afd89da30b7cfc7ca0d7e335c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 6 Jan 2023 23:29:38 +0100 Subject: [PATCH 004/440] Remove `iced_glow`, `glyph-brush`, and `wgpu_glyph` dependencies --- Cargo.toml | 11 +- .../.gitignore | 0 .../Cargo.toml | 2 +- .../README.md | 0 .../index.html | 4 +- .../src/controls.rs | 0 .../src/main.rs | 0 .../src/scene.rs | 0 .../src/shader/frag.wgsl | 0 .../src/shader/vert.wgsl | 0 examples/integration_opengl/Cargo.toml | 12 - examples/integration_opengl/README.md | 16 - examples/integration_opengl/src/controls.rs | 101 --- examples/integration_opengl/src/main.rs | 187 ------ examples/integration_opengl/src/scene.rs | 102 --- glow/Cargo.toml | 51 -- glow/README.md | 51 -- glow/src/backend.rs | 280 --------- glow/src/image.rs | 254 -------- glow/src/image/storage.rs | 78 --- glow/src/lib.rs | 53 -- glow/src/program.rs | 133 ---- glow/src/quad.rs | 74 --- glow/src/quad/compatibility.rs | 349 ---------- glow/src/quad/core.rs | 244 ------- glow/src/settings.rs | 61 -- glow/src/shader/common/gradient.frag | 59 -- glow/src/shader/common/gradient.vert | 9 - glow/src/shader/common/image.frag | 22 - glow/src/shader/common/image.vert | 9 - glow/src/shader/common/solid.frag | 18 - glow/src/shader/common/solid.vert | 11 - glow/src/shader/compatibility/quad.frag | 83 --- glow/src/shader/compatibility/quad.vert | 46 -- glow/src/shader/core/quad.frag | 95 --- glow/src/shader/core/quad.vert | 52 -- glow/src/text.rs | 257 -------- glow/src/triangle.rs | 595 ------------------ glow/src/window.rs | 4 - glow/src/window/compositor.rs | 111 ---- graphics/Cargo.toml | 7 - graphics/src/font.rs | 35 -- graphics/src/font/source.rs | 45 -- graphics/src/lib.rs | 1 - wgpu/Cargo.toml | 4 - wgpu/src/backend.rs | 86 +-- wgpu/src/text.rs | 264 +------- 47 files changed, 30 insertions(+), 3846 deletions(-) rename examples/{integration_wgpu => integration}/.gitignore (100%) rename examples/{integration_wgpu => integration}/Cargo.toml (96%) rename examples/{integration_wgpu => integration}/README.md (100%) rename examples/{integration_wgpu => integration}/index.html (81%) rename examples/{integration_wgpu => integration}/src/controls.rs (100%) rename examples/{integration_wgpu => integration}/src/main.rs (100%) rename examples/{integration_wgpu => integration}/src/scene.rs (100%) rename examples/{integration_wgpu => integration}/src/shader/frag.wgsl (100%) rename examples/{integration_wgpu => integration}/src/shader/vert.wgsl (100%) delete mode 100644 examples/integration_opengl/Cargo.toml delete mode 100644 examples/integration_opengl/README.md delete mode 100644 examples/integration_opengl/src/controls.rs delete mode 100644 examples/integration_opengl/src/main.rs delete mode 100644 examples/integration_opengl/src/scene.rs delete mode 100644 glow/Cargo.toml delete mode 100644 glow/README.md delete mode 100644 glow/src/backend.rs delete mode 100644 glow/src/image.rs delete mode 100644 glow/src/image/storage.rs delete mode 100644 glow/src/lib.rs delete mode 100644 glow/src/program.rs delete mode 100644 glow/src/quad.rs delete mode 100644 glow/src/quad/compatibility.rs delete mode 100644 glow/src/quad/core.rs delete mode 100644 glow/src/settings.rs delete mode 100644 glow/src/shader/common/gradient.frag delete mode 100644 glow/src/shader/common/gradient.vert delete mode 100644 glow/src/shader/common/image.frag delete mode 100644 glow/src/shader/common/image.vert delete mode 100644 glow/src/shader/common/solid.frag delete mode 100644 glow/src/shader/common/solid.vert delete mode 100644 glow/src/shader/compatibility/quad.frag delete mode 100644 glow/src/shader/compatibility/quad.vert delete mode 100644 glow/src/shader/core/quad.frag delete mode 100644 glow/src/shader/core/quad.vert delete mode 100644 glow/src/text.rs delete mode 100644 glow/src/triangle.rs delete mode 100644 glow/src/window.rs delete mode 100644 glow/src/window/compositor.rs delete mode 100644 graphics/src/font.rs delete mode 100644 graphics/src/font/source.rs diff --git a/Cargo.toml b/Cargo.toml index d26ec2b6..42c9488c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,19 +14,15 @@ categories = ["gui"] [features] default = ["wgpu"] # Enables the `Image` widget -image = ["iced_wgpu?/image", "iced_glow?/image", "image_rs"] +image = ["iced_wgpu?/image", "image_rs"] # Enables the `Svg` widget -svg = ["iced_wgpu?/svg", "iced_glow?/svg"] +svg = ["iced_wgpu?/svg"] # Enables the `Canvas` widget canvas = ["iced_graphics/canvas"] # Enables the `QRCode` widget 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", "iced_glow?/default_system_font"] -# Enables the `iced_glow` renderer. Overrides `iced_wgpu` -glow = ["iced_glow", "iced_glutin"] # Enables a debug view in native platforms (press F12) debug = ["iced_winit/debug"] # Enables `tokio` as the `executor::Default` on native platforms @@ -44,7 +40,6 @@ chrome-trace = [ "iced_winit/chrome-trace", "iced_glutin?/trace", "iced_wgpu?/tracing", - "iced_glow?/tracing", ] [badges] @@ -55,7 +50,6 @@ members = [ "core", "futures", "graphics", - "glow", "glutin", "lazy", "native", @@ -72,7 +66,6 @@ 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 } thiserror = "1.0" [dependencies.image_rs] diff --git a/examples/integration_wgpu/.gitignore b/examples/integration/.gitignore similarity index 100% rename from examples/integration_wgpu/.gitignore rename to examples/integration/.gitignore diff --git a/examples/integration_wgpu/Cargo.toml b/examples/integration/Cargo.toml similarity index 96% rename from examples/integration_wgpu/Cargo.toml rename to examples/integration/Cargo.toml index eaa1df7e..200306aa 100644 --- a/examples/integration_wgpu/Cargo.toml +++ b/examples/integration/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "integration_wgpu" +name = "integration" version = "0.1.0" authors = ["Héctor Ramón Jiménez "] edition = "2021" diff --git a/examples/integration_wgpu/README.md b/examples/integration/README.md similarity index 100% rename from examples/integration_wgpu/README.md rename to examples/integration/README.md diff --git a/examples/integration_wgpu/index.html b/examples/integration/index.html similarity index 81% rename from examples/integration_wgpu/index.html rename to examples/integration/index.html index 461e67a4..920bc4a0 100644 --- a/examples/integration_wgpu/index.html +++ b/examples/integration/index.html @@ -8,8 +8,8 @@

integration_wgpu