From 69da283aebe18762a4e80db64547c95fb54df455 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 21 Aug 2023 11:52:19 -0400 Subject: [PATCH] update iced --- Cargo.toml | 6 ++++-- examples/cosmic-sctk/Cargo.toml | 5 ++--- examples/cosmic/Cargo.toml | 4 ++-- iced | 2 +- src/keyboard_nav.rs | 6 +++++- src/widget/aspect_ratio.rs | 2 ++ src/widget/cosmic_container.rs | 2 ++ src/widget/popover.rs | 3 +++ src/widget/rectangle_tracker/mod.rs | 2 ++ src/widget/segmented_button/widget.rs | 7 ++++--- 10 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f73d2d..28c771d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" name = "cosmic" [features] -default = ["wayland", "tokio", "a11y"] +default = ["wayland", "tokio"] # Accessibility support a11y = ["iced/a11y", "iced_accessibility"] # Builds support for animated images @@ -21,7 +21,7 @@ smol = ["iced/smol"] # Tokio async runtime tokio = ["dep:tokio", "ashpd/tokio", "iced/tokio"] # Wayland window support -wayland = ["ashpd?/wayland", "iced/wayland", "iced_sctk", "sctk"] +wayland = ["ashpd?/wayland", "iced_runtime/wayland", "iced/wayland", "iced_sctk", "sctk"] # Render with wgpu wgpu = ["iced/wgpu", "iced_wgpu"] # X11 window support via winit @@ -50,6 +50,7 @@ thiserror = "1.0.44" async-fs = { version = "1.6", optional = true } ashpd = { version = "0.5.0", default-features = false, optional = true } url = "2.4.0" +unicode-segmentation = "1.6" [target.'cfg(unix)'.dependencies] freedesktop-icons = "0.2.2" @@ -120,5 +121,6 @@ exclude = [ "iced", ] + [patch."https://github.com/pop-os/libcosmic"] libcosmic = { path = "./", features = ["wayland", "tokio", "a11y"]} diff --git a/examples/cosmic-sctk/Cargo.toml b/examples/cosmic-sctk/Cargo.toml index cb9332b..9af7561 100644 --- a/examples/cosmic-sctk/Cargo.toml +++ b/examples/cosmic-sctk/Cargo.toml @@ -6,6 +6,5 @@ edition = "2021" publish = false [dependencies] -libcosmic = { path = "../..", default-features = false, features = ["wayland", "tokio", "a11y"] } -cosmic-time = { git = "https://github.com/pop-os/cosmic-time", rev="c39e737", default-features = false, features = ["libcosmic", "once_cell"] } -# cosmic-time = { path = "../../../cosmic-time", default-features = false, features = ["libcosmic", "once_cell"] } +libcosmic = { path = "../..", default-features = false, features = ["wayland", "tokio"] } +cosmic-time = { git = "https://github.com/pop-os/cosmic-time", rev="6f3ff1aa", default-features = false, features = ["libcosmic", "once_cell"] } diff --git a/examples/cosmic/Cargo.toml b/examples/cosmic/Cargo.toml index 0eed300..a71a7b6 100644 --- a/examples/cosmic/Cargo.toml +++ b/examples/cosmic/Cargo.toml @@ -8,9 +8,9 @@ publish = false [dependencies] apply = "0.3.0" fraction = "0.13.0" -libcosmic = { path = "../..", default-features = false, features = ["debug", "winit", "a11y"] } +libcosmic = { path = "../..", default-features = false, features = ["debug", "winit"] } once_cell = "1.18" slotmap = "1.0.6" env_logger = "0.10" log = "0.4.17" -cosmic-time = { git = "https://github.com/pop-os/cosmic-time", rev="c39e737", default-features = false, features = ["libcosmic", "once_cell"] } +cosmic-time = { git = "https://github.com/pop-os/cosmic-time", rev="6f3ff1aa", default-features = false, features = ["libcosmic", "once_cell"] } diff --git a/iced b/iced index 17a1024..2ead0da 160000 --- a/iced +++ b/iced @@ -1 +1 @@ -Subproject commit 17a10240bee93add36c33f451bd028579f89718e +Subproject commit 2ead0da06f6da58b01e107104808b45d6fb61e85 diff --git a/src/keyboard_nav.rs b/src/keyboard_nav.rs index 801c594..40294a0 100644 --- a/src/keyboard_nav.rs +++ b/src/keyboard_nav.rs @@ -8,7 +8,10 @@ use iced::{ keyboard::{self, KeyCode}, mouse, subscription, Command, Event, Subscription, }; -use iced_core::widget::{operation, Id, Operation}; +use iced_core::{ + widget::{operation, Id, Operation}, + Rectangle, +}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum Message { @@ -88,6 +91,7 @@ fn unfocus_operation() -> impl Operation { fn container( &mut self, _id: Option<&Id>, + _bounds: Rectangle, operate_on_children: &mut dyn FnMut(&mut dyn Operation), ) { operate_on_children(self); diff --git a/src/widget/aspect_ratio.rs b/src/widget/aspect_ratio.rs index eae0f89..076abdb 100644 --- a/src/widget/aspect_ratio.rs +++ b/src/widget/aspect_ratio.rs @@ -190,6 +190,7 @@ where renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, + viewport: &Rectangle, ) -> event::Status { self.container.on_event( tree, @@ -199,6 +200,7 @@ where renderer, clipboard, shell, + viewport, ) } diff --git a/src/widget/cosmic_container.rs b/src/widget/cosmic_container.rs index 8972a01..7d170df 100644 --- a/src/widget/cosmic_container.rs +++ b/src/widget/cosmic_container.rs @@ -177,6 +177,7 @@ where renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, + viewport: &Rectangle, ) -> event::Status { self.container.on_event( tree, @@ -186,6 +187,7 @@ where renderer, clipboard, shell, + viewport, ) } diff --git a/src/widget/popover.rs b/src/widget/popover.rs index 2135f7f..754c177 100644 --- a/src/widget/popover.rs +++ b/src/widget/popover.rs @@ -87,6 +87,7 @@ where renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, + viewport: &Rectangle, ) -> event::Status { self.content.as_widget_mut().on_event( &mut tree.children[0], @@ -96,6 +97,7 @@ where renderer, clipboard, shell, + viewport, ) } @@ -221,6 +223,7 @@ where renderer, clipboard, shell, + &layout.bounds(), ) } diff --git a/src/widget/rectangle_tracker/mod.rs b/src/widget/rectangle_tracker/mod.rs index 305634c..a927dec 100644 --- a/src/widget/rectangle_tracker/mod.rs +++ b/src/widget/rectangle_tracker/mod.rs @@ -189,6 +189,7 @@ where renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, + viewport: &iced_core::Rectangle, ) -> event::Status { self.container.on_event( tree, @@ -198,6 +199,7 @@ where renderer, clipboard, shell, + viewport, ) } diff --git a/src/widget/segmented_button/widget.rs b/src/widget/segmented_button/widget.rs index f91654d..42389a4 100644 --- a/src/widget/segmented_button/widget.rs +++ b/src/widget/segmented_button/widget.rs @@ -224,7 +224,7 @@ where // Add text to measurement if text was given. if let Some(text) = self.model.text(key) { - let (w, h) = renderer.measure( + let Size { width, height } = renderer.measure( text, self.font_size, self.line_height, @@ -233,8 +233,8 @@ where Shaping::Advanced, ); - button_width = w; - button_height = h; + button_width = width; + button_height = height; } // Add icon to measurement if icon was given. @@ -307,6 +307,7 @@ where _renderer: &Renderer, _clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, + _viewport: &iced::Rectangle, ) -> event::Status { let bounds = layout.bounds(); let state = tree.state.downcast_mut::();