bump iced/libcosmic to latest
This commit is contained in:
parent
da8240e3d7
commit
dc5a562349
4 changed files with 1279 additions and 1250 deletions
|
|
@ -1,4 +1,4 @@
|
|||
[tools]
|
||||
just = "1.46.0"
|
||||
rust = "1.92.0"
|
||||
rust = "1.93.0"
|
||||
rust-analyzer = "latest"
|
||||
|
|
|
|||
2475
Cargo.lock
generated
2475
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
15
Cargo.toml
15
Cargo.toml
|
|
@ -24,5 +24,20 @@ zbus = { version = "5", default-features = false, features = ["tokio"] }
|
|||
|
||||
[dependencies.libcosmic]
|
||||
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
|
||||
features = ["applet", "tokio", "wayland"]
|
||||
|
|
|
|||
37
src/app.rs
37
src/app.rs
|
|
@ -7,9 +7,10 @@ use cosmic::iced::widget::text::LineHeight;
|
|||
use cosmic::widget::{self, autosize, container, rectangle_tracker::{
|
||||
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::iced_core::Shadow;
|
||||
use cosmic::iced::core::Shadow;
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
@ -170,11 +171,12 @@ impl cosmic::Application for AppModel {
|
|||
let parts: Vec<&str> = self.weather_text.split('|').collect();
|
||||
if parts.len() == 2 {
|
||||
widget::button::custom(
|
||||
widget::row()
|
||||
.push(widget::text(parts[0]).font(cosmic::font::bold()))
|
||||
.push(widget::text("|"))
|
||||
.push(widget::text(parts[1]))
|
||||
.spacing(0),
|
||||
widget::row([
|
||||
widget::text(parts[0]).font(cosmic::font::bold()).into(),
|
||||
widget::text("|").into(),
|
||||
widget::text(parts[1]).into(),
|
||||
])
|
||||
.spacing(0),
|
||||
)
|
||||
.class(cosmic::theme::Button::Text)
|
||||
.on_press(Message::TogglePopup)
|
||||
|
|
@ -267,16 +269,23 @@ impl cosmic::Application for AppModel {
|
|||
container(content).class(cosmic::style::Container::custom(|theme| {
|
||||
let cosmic = theme.cosmic();
|
||||
let corners = cosmic.corner_radii;
|
||||
cosmic::iced_widget::container::Style {
|
||||
text_color: Some(cosmic.background.on.into()),
|
||||
background: Some(Color::from(cosmic.background.base).into()),
|
||||
// `background` became an accessor parameterised by the theme's
|
||||
// transparency, so the popup now follows a transparent panel
|
||||
// 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 {
|
||||
radius: corners.radius_m.into(),
|
||||
width: 1.0,
|
||||
color: cosmic.background.divider.into(),
|
||||
color: background.divider.into(),
|
||||
},
|
||||
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)),
|
||||
// Periodic weather refresh timer
|
||||
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));
|
||||
interval.tick().await; // Skip first tick
|
||||
|
||||
|
|
@ -318,7 +327,7 @@ impl cosmic::Application for AppModel {
|
|||
}),
|
||||
// NetworkManager connectivity change monitor
|
||||
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 {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue