chore: update dependencies and examples

This commit is contained in:
Vukašin Vojinović 2026-03-18 15:54:07 +01:00 committed by GitHub
parent 6c6d16d34a
commit 54bcb9ec12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 76 additions and 87 deletions

View file

@ -115,10 +115,10 @@ x11 = ["iced/x11", "iced_winit/x11"]
[dependencies]
apply = "0.3.0"
ashpd = { version = "0.12.1", default-features = false, optional = true }
ashpd = { version = "0.12.3", default-features = false, optional = true }
async-fs = { version = "2.2", optional = true }
async-std = { version = "1.13", optional = true }
auto_enums = "0.8.7"
auto_enums = "0.8.8"
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "160b086", optional = true }
jiff = "0.2"
cosmic-config = { path = "cosmic-config" }
@ -131,17 +131,16 @@ i18n-embed = { version = "0.16.0", features = [
i18n-embed-fl = "0.10"
rust-embed = "8.11.0"
css-color = "0.2.8"
derive_setters = "0.1.8"
derive_setters = "0.1.9"
futures = "0.3"
image = { version = "0.25.9", default-features = false, features = [
image = { version = "0.25.10", default-features = false, features = [
"jpeg",
"png",
] }
libc = { version = "0.2.180", optional = true }
libc = { version = "0.2.183", optional = true }
log = "0.4"
mime = { version = "0.3.17", optional = true }
palette = "0.7.6"
raw-window-handle = "0.6"
rfd = { version = "0.16.0", default-features = false, features = [
"xdg-portal",
], optional = true }
@ -151,18 +150,18 @@ slotmap = "1.1.1"
smol = { version = "2.0.2", optional = true }
thiserror = "2.0.18"
taffy = { version = "0.9.2", features = ["grid"] }
tokio = { version = "1.49.0", optional = true }
tokio = { version = "1.50.0", optional = true }
tracing = "0.1.44"
unicode-segmentation = "1.12"
url = "2.5.8"
zbus = { version = "5.13.2", default-features = false, optional = true }
zbus = { version = "5.14.0", default-features = false, optional = true }
float-cmp = "0.10.0"
# Enable DBus feature on Linux targets
[target.'cfg(target_os = "linux")'.dependencies]
cosmic-config = { path = "cosmic-config", features = ["dbus"] }
cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings" }
zbus = { version = "5.13.2", default-features = false }
zbus = { version = "5.14.0", default-features = false }
[target.'cfg(unix)'.dependencies]
freedesktop-icons = { package = "cosmic-freedesktop-icons", git = "https://github.com/pop-os/freedesktop-icons" }
@ -242,4 +241,4 @@ exclude = ["iced"]
dirs = "6.0.0"
[dev-dependencies]
tempfile = "3.24.0"
tempfile = "3.27.0"

View file

@ -11,9 +11,9 @@ subscription = ["iced_futures"]
[dependencies]
cosmic-settings-daemon = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true }
zbus = { version = "5.13.2", default-features = false, optional = true }
zbus = { version = "5.14.0", default-features = false, optional = true }
atomicwrites = { git = "https://github.com/jackpot51/rust-atomicwrites" }
calloop = { version = "0.14.3", optional = true }
calloop = { version = "0.14.4", optional = true }
notify = "8.2.0"
ron = "0.12.0"
serde = "1.0.228"
@ -22,7 +22,7 @@ iced = { path = "../iced/", default-features = false, optional = true }
iced_futures = { path = "../iced/futures/", default-features = false, optional = true }
futures-util = { version = "0.3", optional = true }
dirs.workspace = true
tokio = { version = "1.49", optional = true, features = ["time"] }
tokio = { version = "1.50", optional = true, features = ["time"] }
async-std = { version = "1.13", optional = true }
tracing = "0.1"
@ -30,4 +30,4 @@ tracing = "0.1"
xdg = "3.0"
[target.'cfg(windows)'.dependencies]
known-folders = "1.4.0"
known-folders = "1.4.2"

View file

@ -22,7 +22,7 @@ serde_json = { version = "1.0.149", optional = true, features = [
"preserve_order",
] }
ron = "0.12.0"
csscolorparser = { version = "0.8.1", features = ["serde"] }
csscolorparser = { version = "0.8.3", features = ["serde"] }
cosmic-config = { path = "../cosmic-config/", default-features = false, features = [
"subscription",
"macro",

View file

@ -28,13 +28,14 @@ impl State {
column!(
list_column().add(settings::item(
"Bluetooth",
toggler(None, self.enabled, Message::Enable)
toggler(self.enabled).on_toggle(Message::Enable)
)),
text("Now visible as \"TODO\", just kidding")
)
.spacing(8)
.into(),
settings::view_section("Devices")
settings::section()
.title("Devices")
.add(settings::item("No devices found", text("")))
.into(),
])

View file

@ -258,12 +258,13 @@ impl State {
match self.tab_bar.active_data() {
None => panic!("no tab is active"),
Some(DemoView::TabA) => settings::view_column(vec![
settings::view_section("Debug")
settings::section()
.title("Debug")
.add(settings::item("Debug theme", choose_theme))
.add(settings::item("Debug icon theme", choose_icon_theme))
.add(settings::item(
"Debug layout",
toggler(None, window.debug, Message::Debug),
toggler(window.debug).on_toggle(Message::Debug),
))
.add(settings::item(
"Scaling Factor",
@ -276,10 +277,11 @@ impl State {
.into(),
]))
.into(),
settings::view_section("Controls")
settings::section()
.title("Controls")
.add(settings::item(
"Toggler",
toggler(None, self.toggler_value, Message::TogglerToggled),
toggler(self.toggler_value).on_toggle(Message::TogglerToggled),
))
.add(settings::item(
"Pick List (TODO)",
@ -299,14 +301,12 @@ impl State {
.add(settings::item(
"Progress",
progress_bar(0.0..=100.0, self.slider_value)
.width(Length::Fixed(250.0))
.height(Length::Fixed(4.0)),
.length(Length::Fixed(250.0))
.girth(Length::Fixed(4.0)),
))
.add(settings::item_row(vec![checkbox(
"Checkbox",
self.checkbox_value,
Message::CheckboxToggled,
)
.add(settings::item_row(vec![checkbox(self.checkbox_value)
.label("Checkbox")
.on_toggle(Message::CheckboxToggled)
.into()]))
.add(settings::item(
format!(
@ -354,8 +354,7 @@ impl State {
.width(Length::Shrink)
.on_activate(Message::MultiSelection)
.apply(container)
.center_x()
.width(Length::Fill)
.center_x(Length::Fill)
.into(),
text("Vertical With Spacing").into(),
cosmic::iced::widget::row(vec![
@ -424,13 +423,12 @@ impl State {
])
.padding(0)
.into(),
Some(DemoView::TabC) => {
settings::view_column(vec![settings::view_section("Tab C")
Some(DemoView::TabC) => settings::view_column(vec![settings::section()
.title("Tab C")
.add(text("Nothing here yet").width(Length::Fill))
.into()])
.padding(0)
.into()
}
.into(),
},
container(text("Background container with some text").size(24))
.layer(cosmic_theme::Layer::Background)

View file

@ -147,7 +147,8 @@ impl State {
fn view_desktop_options<'a>(&'a self, window: &'a Window) -> Element<'a, Message> {
settings::view_column(vec![
window.parent_page_button(DesktopPage::DesktopOptions),
settings::view_section("Super Key Action")
settings::section()
.title("Super Key Action")
.add(settings::item("Launcher", horizontal_space(Length::Fill)))
.add(settings::item("Workspaces", horizontal_space(Length::Fill)))
.add(settings::item(
@ -155,38 +156,34 @@ impl State {
horizontal_space(Length::Fill),
))
.into(),
settings::view_section("Hot Corner")
settings::section()
.title("Hot Corner")
.add(settings::item(
"Enable top-left hot corner for Workspaces",
toggler(None, self.top_left_hot_corner, Message::TopLeftHotCorner),
toggler(self.top_left_hot_corner).on_toggle(Message::TopLeftHotCorner),
))
.into(),
settings::view_section("Top Panel")
settings::section()
.title("Top Panel")
.add(settings::item(
"Show Workspaces Button",
toggler(
None,
self.show_workspaces_button,
Message::ShowWorkspacesButton,
),
toggler(self.show_workspaces_button).on_toggle(Message::ShowWorkspacesButton),
))
.add(settings::item(
"Show Applications Button",
toggler(
None,
self.show_applications_button,
Message::ShowApplicationsButton,
),
toggler(self.show_applications_button)
.on_toggle(Message::ShowApplicationsButton),
))
.into(),
settings::view_section("Window Controls")
settings::section()
.title("Window Controls")
.add(settings::item(
"Show Minimize Button",
toggler(None, self.show_minimize_button, Message::ShowMinimizeButton),
toggler(self.show_minimize_button).on_toggle(Message::ShowMinimizeButton),
))
.add(settings::item(
"Show Maximize Button",
toggler(None, self.show_maximize_button, Message::ShowMaximizeButton),
toggler(self.show_maximize_button).on_toggle(Message::ShowMaximizeButton),
))
.into(),
])
@ -245,12 +242,12 @@ impl State {
list_column()
.add(settings::item(
"Same background on all displays",
toggler(None, self.same_background, Message::SameBackground),
toggler(self.same_background).on_toggle(Message::SameBackground),
))
.add(settings::item("Background fit", text("TODO")))
.add(settings::item(
"Slideshow",
toggler(None, self.slideshow, Message::Slideshow),
toggler(self.slideshow).on_toggle(Message::Slideshow),
))
.into(),
column(image_column).spacing(16).into(),
@ -261,7 +258,8 @@ impl State {
fn view_desktop_workspaces<'a>(&'a self, window: &'a Window) -> Element<'a, Message> {
settings::view_column(vec![
window.parent_page_button(DesktopPage::Wallpaper),
settings::view_section("Workspace Behavior")
settings::section()
.title("Workspace Behavior")
.add(settings::item(
"Dynamic workspaces",
horizontal_space(Length::Fill),
@ -271,7 +269,8 @@ impl State {
horizontal_space(Length::Fill),
))
.into(),
settings::view_section("Multi-monitor Behavior")
settings::section()
.title("Multi-monitor Behavior")
.add(settings::item(
"Workspaces Span Displays",
horizontal_space(Length::Fill),

View file

@ -69,14 +69,16 @@ impl State {
list_column()
.add(settings::item("Device name", text("TODO")))
.into(),
settings::view_section("Hardware")
settings::section()
.title("Hardware")
.add(settings::item("Hardware model", text("TODO")))
.add(settings::item("Memory", text("TODO")))
.add(settings::item("Processor", text("TODO")))
.add(settings::item("Graphics", text("TODO")))
.add(settings::item("Disk Capacity", text("TODO")))
.into(),
settings::view_section("Operating System")
settings::section()
.title("Operating System")
.add(settings::item("Operating system", text("TODO")))
.add(settings::item(
"Operating system architecture",
@ -85,7 +87,8 @@ impl State {
.add(settings::item("Desktop environment", text("TODO")))
.add(settings::item("Windowing system", text("TODO")))
.into(),
settings::view_section("Related settings")
settings::section()
.title("Related settings")
.add(settings::item("Get support", text("TODO")))
.into(),
])

View file

@ -49,8 +49,8 @@ pub fn windowing_system() -> Option<WindowingSystem> {
WINDOWING_SYSTEM.get().copied()
}
fn init_windowing_system<M>(handle: raw_window_handle::WindowHandle) -> crate::Action<M> {
let raw: &raw_window_handle::RawWindowHandle = handle.as_ref();
fn init_windowing_system<M>(handle: window::raw_window_handle::WindowHandle) -> crate::Action<M> {
let raw = handle.as_ref();
let system = match raw {
window::raw_window_handle::RawWindowHandle::UiKit(_) => WindowingSystem::UiKit,
window::raw_window_handle::RawWindowHandle::AppKit(_) => WindowingSystem::AppKit,

View file

@ -197,7 +197,16 @@ impl<'a, Message: Clone + 'static> Widget<Message, crate::Theme, crate::Renderer
);
let start_width = start_node.size().width;
let (center_node, center_x) = if let Some(center) = &mut self.center {
let vcenter = |node: layout::Node, x: f32| -> layout::Node {
let dy = ((height - node.size().height) / 2.0).max(0.0);
node.translate(Vector::new(x, dy))
};
let mut child_nodes = Vec::with_capacity(3);
child_nodes.push(vcenter(start_node, 0.0));
child_nodes.push(vcenter(end_node, width - end_width));
if let Some(center) = &mut self.center {
let slot_start = start_width + gap;
let slot_end = (width - end_width - gap).max(slot_start);
let slot_width = slot_end - slot_start;
@ -217,21 +226,8 @@ impl<'a, Message: Clone + 'static> Widget<Message, crate::Theme, crate::Renderer
let ideal_x = (width - natural_width) / 2.0;
let max_x = (width - end_width - gap - natural_width).max(slot_start);
let center_x = ideal_x.clamp(slot_start, max_x);
(Some(node), center_x)
} else {
(None, 0.0)
};
let vcenter = |node: layout::Node, x: f32| -> layout::Node {
let dy = ((height - node.size().height) / 2.0).max(0.0);
node.translate(Vector::new(x, dy))
};
let mut child_nodes = Vec::with_capacity(3);
child_nodes.push(vcenter(start_node, 0.0));
child_nodes.push(vcenter(end_node, width - end_width));
if let Some(cn) = center_node {
child_nodes.push(vcenter(cn, center_x));
child_nodes.push(vcenter(node, center_x))
}
layout::Node::with_children(Size::new(width, height), child_nodes)
@ -398,8 +394,7 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
} else {
match (
self.density.unwrap_or_else(crate::config::header_size),
// Center content depending on window border
self.maximized,
self.maximized, // window border handling
) {
(Density::Compact, true) => [4, 8, 4, 8],
(Density::Compact, false) => [3, 7, 4, 7],

View file

@ -5,12 +5,6 @@ use crate::Element;
use crate::widget::{ListColumn, column, text};
use std::borrow::Cow;
/// A section within a settings view column.
#[deprecated(note = "use `settings::section().title()` instead")]
pub fn view_section<'a, Message: 'static>(title: impl Into<Cow<'a, str>>) -> Section<'a, Message> {
section().title(title)
}
/// A section within a settings view column.
pub fn section<'a, Message: 'static>() -> Section<'a, Message> {
with_column(ListColumn::default())