bump iced/libcosmic to latest
Some checks failed
CI / Clippy (push) Failing after 1m42s
CI / Build (release) (push) Successful in 2m50s
CI / Build (debug) (push) Successful in 3m47s
CI / Notify (push) Successful in 2s

This commit is contained in:
Emil Lerch 2026-08-11 13:47:33 -07:00
parent da8240e3d7
commit dc5a562349
Signed by: lobo
GPG key ID: A7B62D657EF764F8
4 changed files with 1279 additions and 1250 deletions

View file

@ -1,4 +1,4 @@
[tools] [tools]
just = "1.46.0" just = "1.46.0"
rust = "1.92.0" rust = "1.93.0"
rust-analyzer = "latest" rust-analyzer = "latest"

2475
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -24,5 +24,20 @@ zbus = { version = "5", default-features = false, features = ["tokio"] }
[dependencies.libcosmic] [dependencies.libcosmic]
git = "https://github.com/pop-os/libcosmic.git" git = "https://github.com/pop-os/libcosmic.git"
# Pinned rather than tracking the branch, so the resolved revision is explicit.
#
# The previous floating dependency had resolved to a January build whose vendored
# pop-os/iced predated 686c6afb8 ("fix(sctk): popup initial configure ack
# handling"). Without that fix, creating a popup or tooltip surface could attach a
# buffer before acknowledging the initial configure, and the compositor killed the
# applet -- libcosmic#1166.
#
# An older revision that merely contains the fix is not practical: libcosmic
# declares several dependencies (cosmic-text, iced's own tree) as floating git
# deps with no revision, so an old libcosmic resolves against today's versions of
# them and fails to compile. There is no committed Cargo.lock in libcosmic to
# reconstruct a contemporaneous graph from, so tracking a recent revision is the
# maintainable option.
rev = "1f8d8786940cc6db59d412153c5a03f69a20375c"
default-features = false default-features = false
features = ["applet", "tokio", "wayland"] features = ["applet", "tokio", "wayland"]

View file

@ -7,9 +7,10 @@ use cosmic::iced::widget::text::LineHeight;
use cosmic::widget::{self, autosize, container, rectangle_tracker::{ use cosmic::widget::{self, autosize, container, rectangle_tracker::{
RectangleTracker, RectangleUpdate, rectangle_tracker_subscription, RectangleTracker, RectangleUpdate, rectangle_tracker_subscription,
}}; }};
use cosmic::{iced_futures, prelude::*, surface}; use cosmic::{prelude::*, surface};
use cosmic::iced::futures::channel::mpsc::Sender;
use cosmic::applet::cosmic_panel_config::PanelAnchor; use cosmic::applet::cosmic_panel_config::PanelAnchor;
use cosmic::iced_core::Shadow; use cosmic::iced::core::Shadow;
use futures_util::{SinkExt, StreamExt}; use futures_util::{SinkExt, StreamExt};
use std::time::Duration; use std::time::Duration;
@ -170,10 +171,11 @@ impl cosmic::Application for AppModel {
let parts: Vec<&str> = self.weather_text.split('|').collect(); let parts: Vec<&str> = self.weather_text.split('|').collect();
if parts.len() == 2 { if parts.len() == 2 {
widget::button::custom( widget::button::custom(
widget::row() widget::row([
.push(widget::text(parts[0]).font(cosmic::font::bold())) widget::text(parts[0]).font(cosmic::font::bold()).into(),
.push(widget::text("|")) widget::text("|").into(),
.push(widget::text(parts[1])) widget::text(parts[1]).into(),
])
.spacing(0), .spacing(0),
) )
.class(cosmic::theme::Button::Text) .class(cosmic::theme::Button::Text)
@ -267,16 +269,23 @@ impl cosmic::Application for AppModel {
container(content).class(cosmic::style::Container::custom(|theme| { container(content).class(cosmic::style::Container::custom(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let corners = cosmic.corner_radii; let corners = cosmic.corner_radii;
cosmic::iced_widget::container::Style { // `background` became an accessor parameterised by the theme's
text_color: Some(cosmic.background.on.into()), // transparency, so the popup now follows a transparent panel
background: Some(Color::from(cosmic.background.base).into()), // rather than always painting an opaque surface.
let background = cosmic.background(theme.transparent);
cosmic::iced::widget::container::Style {
text_color: Some(background.on.into()),
background: Some(Color::from(background.base).into()),
border: cosmic::iced::Border { border: cosmic::iced::Border {
radius: corners.radius_m.into(), radius: corners.radius_m.into(),
width: 1.0, width: 1.0,
color: cosmic.background.divider.into(), color: background.divider.into(),
}, },
shadow: Shadow::default(), shadow: Shadow::default(),
icon_color: Some(cosmic.background.on.into()), icon_color: Some(background.on.into()),
// Snap to the pixel grid, matching libcosmic's own popup
// container, so the 1px border stays crisp.
snap: true,
} }
})) }))
) )
@ -306,7 +315,7 @@ impl cosmic::Application for AppModel {
rectangle_tracker_subscription(0).map(|e| Message::Rectangle(e.1)), rectangle_tracker_subscription(0).map(|e| Message::Rectangle(e.1)),
// Periodic weather refresh timer // Periodic weather refresh timer
Subscription::run(|| { Subscription::run(|| {
iced_futures::stream::channel(1, |mut emitter| async move { cosmic::iced::stream::channel(1, |mut emitter: Sender<Message>| async move {
let mut interval = tokio::time::interval(Duration::from_secs(WEATHER_UPDATE_INTERVAL_MINUTES * 60)); let mut interval = tokio::time::interval(Duration::from_secs(WEATHER_UPDATE_INTERVAL_MINUTES * 60));
interval.tick().await; // Skip first tick interval.tick().await; // Skip first tick
@ -318,7 +327,7 @@ impl cosmic::Application for AppModel {
}), }),
// NetworkManager connectivity change monitor // NetworkManager connectivity change monitor
Subscription::run(|| { Subscription::run(|| {
iced_futures::stream::channel(1, |mut emitter| async move { cosmic::iced::stream::channel(1, |mut emitter: Sender<Message>| async move {
let connection = match zbus::Connection::system().await { let connection = match zbus::Connection::system().await {
Ok(c) => c, Ok(c) => c,
Err(e) => { Err(e) => {