update iced
This commit is contained in:
parent
2086a0ee0e
commit
69da283aeb
10 changed files with 27 additions and 12 deletions
|
|
@ -7,7 +7,7 @@ edition = "2021"
|
||||||
name = "cosmic"
|
name = "cosmic"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["wayland", "tokio", "a11y"]
|
default = ["wayland", "tokio"]
|
||||||
# Accessibility support
|
# Accessibility support
|
||||||
a11y = ["iced/a11y", "iced_accessibility"]
|
a11y = ["iced/a11y", "iced_accessibility"]
|
||||||
# Builds support for animated images
|
# Builds support for animated images
|
||||||
|
|
@ -21,7 +21,7 @@ smol = ["iced/smol"]
|
||||||
# Tokio async runtime
|
# Tokio async runtime
|
||||||
tokio = ["dep:tokio", "ashpd/tokio", "iced/tokio"]
|
tokio = ["dep:tokio", "ashpd/tokio", "iced/tokio"]
|
||||||
# Wayland window support
|
# 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
|
# Render with wgpu
|
||||||
wgpu = ["iced/wgpu", "iced_wgpu"]
|
wgpu = ["iced/wgpu", "iced_wgpu"]
|
||||||
# X11 window support via winit
|
# X11 window support via winit
|
||||||
|
|
@ -50,6 +50,7 @@ thiserror = "1.0.44"
|
||||||
async-fs = { version = "1.6", optional = true }
|
async-fs = { version = "1.6", optional = true }
|
||||||
ashpd = { version = "0.5.0", default-features = false, optional = true }
|
ashpd = { version = "0.5.0", default-features = false, optional = true }
|
||||||
url = "2.4.0"
|
url = "2.4.0"
|
||||||
|
unicode-segmentation = "1.6"
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
freedesktop-icons = "0.2.2"
|
freedesktop-icons = "0.2.2"
|
||||||
|
|
@ -120,5 +121,6 @@ exclude = [
|
||||||
"iced",
|
"iced",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
[patch."https://github.com/pop-os/libcosmic"]
|
[patch."https://github.com/pop-os/libcosmic"]
|
||||||
libcosmic = { path = "./", features = ["wayland", "tokio", "a11y"]}
|
libcosmic = { path = "./", features = ["wayland", "tokio", "a11y"]}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,5 @@ edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libcosmic = { path = "../..", default-features = false, features = ["wayland", "tokio", "a11y"] }
|
libcosmic = { path = "../..", default-features = false, features = ["wayland", "tokio"] }
|
||||||
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"] }
|
||||||
# cosmic-time = { path = "../../../cosmic-time", default-features = false, features = ["libcosmic", "once_cell"] }
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ publish = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
apply = "0.3.0"
|
apply = "0.3.0"
|
||||||
fraction = "0.13.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"
|
once_cell = "1.18"
|
||||||
slotmap = "1.0.6"
|
slotmap = "1.0.6"
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
log = "0.4.17"
|
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"] }
|
||||||
|
|
|
||||||
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit 17a10240bee93add36c33f451bd028579f89718e
|
Subproject commit 2ead0da06f6da58b01e107104808b45d6fb61e85
|
||||||
|
|
@ -8,7 +8,10 @@ use iced::{
|
||||||
keyboard::{self, KeyCode},
|
keyboard::{self, KeyCode},
|
||||||
mouse, subscription, Command, Event, Subscription,
|
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)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
|
|
@ -88,6 +91,7 @@ fn unfocus_operation<T>() -> impl Operation<T> {
|
||||||
fn container(
|
fn container(
|
||||||
&mut self,
|
&mut self,
|
||||||
_id: Option<&Id>,
|
_id: Option<&Id>,
|
||||||
|
_bounds: Rectangle,
|
||||||
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
|
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
|
||||||
) {
|
) {
|
||||||
operate_on_children(self);
|
operate_on_children(self);
|
||||||
|
|
|
||||||
|
|
@ -190,6 +190,7 @@ where
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
clipboard: &mut dyn Clipboard,
|
clipboard: &mut dyn Clipboard,
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
|
viewport: &Rectangle,
|
||||||
) -> event::Status {
|
) -> event::Status {
|
||||||
self.container.on_event(
|
self.container.on_event(
|
||||||
tree,
|
tree,
|
||||||
|
|
@ -199,6 +200,7 @@ where
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
|
viewport,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ where
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
clipboard: &mut dyn Clipboard,
|
clipboard: &mut dyn Clipboard,
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
|
viewport: &Rectangle,
|
||||||
) -> event::Status {
|
) -> event::Status {
|
||||||
self.container.on_event(
|
self.container.on_event(
|
||||||
tree,
|
tree,
|
||||||
|
|
@ -186,6 +187,7 @@ where
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
|
viewport,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ where
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
clipboard: &mut dyn Clipboard,
|
clipboard: &mut dyn Clipboard,
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
|
viewport: &Rectangle,
|
||||||
) -> event::Status {
|
) -> event::Status {
|
||||||
self.content.as_widget_mut().on_event(
|
self.content.as_widget_mut().on_event(
|
||||||
&mut tree.children[0],
|
&mut tree.children[0],
|
||||||
|
|
@ -96,6 +97,7 @@ where
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
|
viewport,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,6 +223,7 @@ where
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
|
&layout.bounds(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,7 @@ where
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
clipboard: &mut dyn Clipboard,
|
clipboard: &mut dyn Clipboard,
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
|
viewport: &iced_core::Rectangle,
|
||||||
) -> event::Status {
|
) -> event::Status {
|
||||||
self.container.on_event(
|
self.container.on_event(
|
||||||
tree,
|
tree,
|
||||||
|
|
@ -198,6 +199,7 @@ where
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
|
viewport,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,7 @@ where
|
||||||
|
|
||||||
// Add text to measurement if text was given.
|
// Add text to measurement if text was given.
|
||||||
if let Some(text) = self.model.text(key) {
|
if let Some(text) = self.model.text(key) {
|
||||||
let (w, h) = renderer.measure(
|
let Size { width, height } = renderer.measure(
|
||||||
text,
|
text,
|
||||||
self.font_size,
|
self.font_size,
|
||||||
self.line_height,
|
self.line_height,
|
||||||
|
|
@ -233,8 +233,8 @@ where
|
||||||
Shaping::Advanced,
|
Shaping::Advanced,
|
||||||
);
|
);
|
||||||
|
|
||||||
button_width = w;
|
button_width = width;
|
||||||
button_height = h;
|
button_height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add icon to measurement if icon was given.
|
// Add icon to measurement if icon was given.
|
||||||
|
|
@ -307,6 +307,7 @@ where
|
||||||
_renderer: &Renderer,
|
_renderer: &Renderer,
|
||||||
_clipboard: &mut dyn Clipboard,
|
_clipboard: &mut dyn Clipboard,
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
|
_viewport: &iced::Rectangle,
|
||||||
) -> event::Status {
|
) -> event::Status {
|
||||||
let bounds = layout.bounds();
|
let bounds = layout.bounds();
|
||||||
let state = tree.state.downcast_mut::<LocalState>();
|
let state = tree.state.downcast_mut::<LocalState>();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue