Update libcosmic/iced

This commit is contained in:
Ian Douglas Scott 2023-12-04 17:01:22 -08:00 committed by Ashley Wulber
parent b7b7b9541e
commit 0e84d0f3cb
4 changed files with 371 additions and 333 deletions

692
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,7 @@ use cctk::wayland_client::protocol::wl_data_device_manager::DndAction;
use cctk::wayland_client::protocol::wl_seat::WlSeat; use cctk::wayland_client::protocol::wl_seat::WlSeat;
use cosmic::cosmic_config::{self, Config, CosmicConfigEntry}; use cosmic::cosmic_config::{self, Config, CosmicConfigEntry};
use cosmic::iced; use cosmic::iced;
use cosmic::iced::subscription::events_with; use cosmic::iced::event::listen_with;
use cosmic::iced::wayland::actions::data_device::DataFromMimeType; use cosmic::iced::wayland::actions::data_device::DataFromMimeType;
use cosmic::iced::wayland::actions::data_device::DndIcon; use cosmic::iced::wayland::actions::data_device::DndIcon;
use cosmic::iced::wayland::popup::destroy_popup; use cosmic::iced::wayland::popup::destroy_popup;
@ -1095,7 +1095,7 @@ impl cosmic::Application for CosmicAppList {
fn subscription(&self) -> Subscription<Message> { fn subscription(&self) -> Subscription<Message> {
Subscription::batch(vec![ Subscription::batch(vec![
wayland_subscription(self.subscription_ctr).map(Message::Wayland), wayland_subscription(self.subscription_ctr).map(Message::Wayland),
events_with(|e, _| match e { listen_with(|e, _| match e {
cosmic::iced_runtime::core::Event::PlatformSpecific( cosmic::iced_runtime::core::Event::PlatformSpecific(
event::PlatformSpecific::Wayland(event::wayland::Event::Seat(e, seat)), event::PlatformSpecific::Wayland(event::wayland::Event::Seat(e, seat)),
) => match e { ) => match e {

View file

@ -6,8 +6,7 @@ use cosmic::applet::{menu_button, padded_control};
use cosmic::iced; use cosmic::iced;
use cosmic::iced::alignment::{Horizontal, Vertical}; use cosmic::iced::alignment::{Horizontal, Vertical};
use cosmic::iced::event::wayland::{self, LayerEvent}; use cosmic::iced::event::wayland::{self, LayerEvent};
use cosmic::iced::event::PlatformSpecific; use cosmic::iced::event::{listen_with, PlatformSpecific};
use cosmic::iced::subscription::events_with;
use cosmic::iced::time; use cosmic::iced::time;
use cosmic::iced::wayland::actions::layer_surface::SctkLayerSurfaceSettings; use cosmic::iced::wayland::actions::layer_surface::SctkLayerSurfaceSettings;
use cosmic::iced::wayland::popup::{destroy_popup, get_popup}; use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
@ -110,7 +109,7 @@ impl cosmic::Application for Power {
fn subscription(&self) -> Subscription<Message> { fn subscription(&self) -> Subscription<Message> {
let mut subscriptions = Vec::with_capacity(2); let mut subscriptions = Vec::with_capacity(2);
subscriptions.push(events_with(|e, _status| match e { subscriptions.push(listen_with(|e, _status| match e {
cosmic::iced::Event::PlatformSpecific(PlatformSpecific::Wayland( cosmic::iced::Event::PlatformSpecific(PlatformSpecific::Wayland(
wayland::Event::Layer(LayerEvent::Unfocused, ..), wayland::Event::Layer(LayerEvent::Unfocused, ..),
)) => Some(Message::Cancel), )) => Some(Message::Cancel),

View file

@ -1,5 +1,6 @@
use cctk::sctk::reexports::{calloop::channel::SyncSender, client::backend::ObjectId}; use cctk::sctk::reexports::{calloop::channel::SyncSender, client::backend::ObjectId};
use cosmic::iced::alignment::{Horizontal, Vertical}; use cosmic::iced::alignment::{Horizontal, Vertical};
use cosmic::iced::event;
use cosmic::iced::mouse::{self, ScrollDelta}; use cosmic::iced::mouse::{self, ScrollDelta};
use cosmic::iced::widget::{button, column, container, row, text}; use cosmic::iced::widget::{button, column, container, row, text};
use cosmic::iced::{subscription, Event::Mouse, Length, Subscription}; use cosmic::iced::{subscription, Event::Mouse, Length, Subscription};
@ -224,7 +225,7 @@ impl cosmic::Application for IcedWorkspacesApplet {
fn subscription(&self) -> Subscription<Message> { fn subscription(&self) -> Subscription<Message> {
Subscription::batch(vec![ Subscription::batch(vec![
workspaces(0).map(Message::WorkspaceUpdate), workspaces(0).map(Message::WorkspaceUpdate),
subscription::events_with(|e, _| match e { event::listen_with(|e, _| match e {
Mouse(mouse::Event::WheelScrolled { delta }) => Some(Message::WheelScrolled(delta)), Mouse(mouse::Event::WheelScrolled { delta }) => Some(Message::WheelScrolled(delta)),
_ => None, _ => None,
}), }),