chore: udpate libcosmic
This commit is contained in:
parent
61d1d1b91d
commit
c54ddeb38a
17 changed files with 139 additions and 426 deletions
|
|
@ -20,6 +20,7 @@ use cctk::{
|
|||
},
|
||||
};
|
||||
use cosmic::{
|
||||
app,
|
||||
applet::{
|
||||
cosmic_panel_config::{PanelAnchor, PanelSize},
|
||||
Context, Size,
|
||||
|
|
@ -36,7 +37,7 @@ use cosmic::{
|
|||
},
|
||||
iced_core::{Border, Padding, Shadow},
|
||||
iced_runtime::{core::event, dnd::peek_dnd},
|
||||
surface_message::{MessageWrapper, SurfaceMessage},
|
||||
surface,
|
||||
theme::{self, Button, Container},
|
||||
widget::{
|
||||
button, divider, dnd_source, horizontal_space,
|
||||
|
|
@ -372,22 +373,7 @@ enum Message {
|
|||
ConfigUpdated(AppListConfig),
|
||||
OpenFavorites,
|
||||
OpenActive,
|
||||
Surface(SurfaceMessage),
|
||||
}
|
||||
|
||||
impl From<Message> for MessageWrapper<Message> {
|
||||
fn from(value: Message) -> Self {
|
||||
match value {
|
||||
Message::Surface(s) => MessageWrapper::Surface(s),
|
||||
m => MessageWrapper::Message(m),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SurfaceMessage> for Message {
|
||||
fn from(value: SurfaceMessage) -> Self {
|
||||
Message::Surface(value)
|
||||
}
|
||||
Surface(surface::Action),
|
||||
}
|
||||
|
||||
fn index_in_list(
|
||||
|
|
@ -606,10 +592,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
type Flags = ();
|
||||
const APP_ID: &'static str = APP_ID;
|
||||
|
||||
fn init(
|
||||
core: cosmic::app::Core,
|
||||
_flags: Self::Flags,
|
||||
) -> (Self, iced::Task<cosmic::app::Message<Self::Message>>) {
|
||||
fn init(core: cosmic::app::Core, _flags: Self::Flags) -> (Self, app::Task<Self::Message>) {
|
||||
let config = Config::new(APP_ID, AppListConfig::VERSION)
|
||||
.ok()
|
||||
.and_then(|c| AppListConfig::get_entry(&c).ok())
|
||||
|
|
@ -639,7 +622,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
(
|
||||
app_list,
|
||||
Task::perform(try_get_gpus(), |gpus| {
|
||||
cosmic::app::Message::App(Message::GpuRequest(gpus))
|
||||
cosmic::Action::App(Message::GpuRequest(gpus))
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
|
@ -652,10 +635,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
&mut self.core
|
||||
}
|
||||
|
||||
fn update(
|
||||
&mut self,
|
||||
message: Self::Message,
|
||||
) -> iced::Task<cosmic::app::Message<Self::Message>> {
|
||||
fn update(&mut self, message: Self::Message) -> app::Task<Self::Message> {
|
||||
match message {
|
||||
Message::Popup(id, parent_window_id) => {
|
||||
if let Some(Popup {
|
||||
|
|
@ -715,7 +695,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
};
|
||||
|
||||
let gpu_update = Task::perform(try_get_gpus(), |gpus| {
|
||||
cosmic::app::Message::App(Message::GpuRequest(gpus))
|
||||
cosmic::Action::App(Message::GpuRequest(gpus))
|
||||
});
|
||||
return Task::batch([gpu_update, get_popup(popup_settings)]);
|
||||
}
|
||||
|
|
@ -939,7 +919,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
// TODO dnd
|
||||
return peek_dnd::<DndPathBuf>()
|
||||
.map(Message::DndData)
|
||||
.map(cosmic::app::Message::App);
|
||||
.map(cosmic::Action::App);
|
||||
}
|
||||
}
|
||||
Message::DndMotion(x, y) => {
|
||||
|
|
@ -1067,7 +1047,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
},
|
||||
|_| Message::IncrementSubscriptionCtr,
|
||||
)
|
||||
.map(cosmic::app::message::app);
|
||||
.map(cosmic::action::app);
|
||||
}
|
||||
WaylandUpdate::Toplevel(event) => match event {
|
||||
ToplevelUpdate::Add(mut info) => {
|
||||
|
|
@ -1370,7 +1350,11 @@ impl cosmic::Application for CosmicAppList {
|
|||
return self.close_popups();
|
||||
}
|
||||
}
|
||||
Message::Surface(surface_message) => {}
|
||||
Message::Surface(a) => {
|
||||
return cosmic::task::message(cosmic::Action::Cosmic(
|
||||
cosmic::app::Action::Surface(a),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Task::none()
|
||||
|
|
@ -1419,7 +1403,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
.map(|dock_item| {
|
||||
self.core
|
||||
.applet
|
||||
.applet_tooltip(
|
||||
.applet_tooltip::<Message>(
|
||||
dock_item.as_icon(
|
||||
&self.core.applet,
|
||||
self.rectangle_tracker.as_ref(),
|
||||
|
|
@ -1439,6 +1423,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
self.popup.is_some(),
|
||||
Message::Surface,
|
||||
)
|
||||
.into()
|
||||
})
|
||||
|
|
@ -1532,6 +1517,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
self.popup.is_some(),
|
||||
Message::Surface,
|
||||
)
|
||||
.into()
|
||||
})
|
||||
|
|
@ -1948,6 +1934,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
self.popup.is_some(),
|
||||
Message::Surface,
|
||||
)
|
||||
.into()
|
||||
})
|
||||
|
|
@ -2046,6 +2033,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
self.popup.is_some(),
|
||||
Message::Surface,
|
||||
)
|
||||
.into()
|
||||
})
|
||||
|
|
@ -2130,7 +2118,7 @@ impl cosmic::Application for CosmicAppList {
|
|||
|
||||
impl CosmicAppList {
|
||||
/// Close any open popups.
|
||||
fn close_popups(&mut self) -> Task<cosmic::app::Message<Message>> {
|
||||
fn close_popups(&mut self) -> Task<cosmic::Action<Message>> {
|
||||
let mut commands = Vec::new();
|
||||
if let Some(popup) = self.popup.take() {
|
||||
commands.push(destroy_popup(popup.id));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue