chore: update libcosmic

This commit is contained in:
Ashley Wulber 2025-03-19 12:27:00 -04:00 • committed by Jeremy Soller
parent 91f252c882
commit a4dd9ab142
3 changed files with 544 additions and 516 deletions

1009
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -61,6 +61,8 @@ wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"]
[profile.release-with-debug] [profile.release-with-debug]
inherits = "release" inherits = "release"
debug = true debug = true
[patch.crates-io]
xdg-mime = { git = "https://github.com/ellieplayswow/xdg-mime-rs", branch = "feature/get-same-as" }
# [patch.'https://github.com/pop-os/libcosmic'] # [patch.'https://github.com/pop-os/libcosmic']
# libcosmic = { path = "../libcosmic" } # libcosmic = { path = "../libcosmic" }

View file

@ -7,9 +7,9 @@ use cosmic::iced::clipboard::dnd::DndAction;
use cosmic::widget::menu::action::MenuAction; use cosmic::widget::menu::action::MenuAction;
use cosmic::widget::menu::key_bind::KeyBind; use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::widget::DndDestination; use cosmic::widget::DndDestination;
use cosmic::Apply;
use cosmic::{ use cosmic::{
app::{command, context_drawer, message, Core, Settings, Task}, action,
app::{context_drawer, Core, Settings, Task},
cosmic_config::{self, ConfigSet, CosmicConfigEntry}, cosmic_config::{self, ConfigSet, CosmicConfigEntry},
cosmic_theme, executor, cosmic_theme, executor,
iced::{ iced::{
@ -25,6 +25,7 @@ use cosmic::{
widget::{self, button, pane_grid, segmented_button, PaneGrid}, widget::{self, button, pane_grid, segmented_button, PaneGrid},
Application, ApplicationExt, Element, Application, ApplicationExt, Element,
}; };
use cosmic::{surface, Apply};
use cosmic_files::dialog::{Dialog, DialogKind, DialogMessage, DialogResult}; use cosmic_files::dialog::{Dialog, DialogKind, DialogMessage, DialogResult};
use cosmic_text::{fontdb::FaceInfo, Family, Stretch, Weight}; use cosmic_text::{fontdb::FaceInfo, Family, Stretch, Weight};
use localize::LANGUAGE_SORTER; use localize::LANGUAGE_SORTER;
@ -338,6 +339,7 @@ pub enum Message {
ProfileRemove(ProfileId), ProfileRemove(ProfileId),
ProfileSyntaxTheme(ProfileId, ColorSchemeKind, usize), ProfileSyntaxTheme(ProfileId, ColorSchemeKind, usize),
ProfileTabTitle(ProfileId, String), ProfileTabTitle(ProfileId, String),
Surface(surface::Action),
SelectAll(Option<segmented_button::Entity>), SelectAll(Option<segmented_button::Entity>),
ShowAdvancedFontSettings(bool), ShowAdvancedFontSettings(bool),
ShowHeaderBar(bool), ShowHeaderBar(bool),
@ -514,7 +516,7 @@ impl App {
self.core.window.show_headerbar = self.config.show_headerbar; self.core.window.show_headerbar = self.config.show_headerbar;
// Update application theme // Update application theme
cosmic::app::command::set_theme(theme) cosmic::command::set_theme(theme)
} }
fn update_render_active_pane_zoom(&mut self, zoom_message: Message) -> Task<Message> { fn update_render_active_pane_zoom(&mut self, zoom_message: Message) -> Task<Message> {
@ -790,7 +792,7 @@ impl App {
value, value,
) )
}) })
.on_submit(Message::ColorSchemeRenameSubmit) .on_submit(|_| Message::ColorSchemeRenameSubmit)
.into(), .into(),
popover.into(), popover.into(),
]), ]),
@ -942,7 +944,7 @@ impl App {
.add( .add(
//TODO: rename to color-scheme-dark? //TODO: rename to color-scheme-dark?
widget::settings::item::builder(fl!("syntax-dark")).control( widget::settings::item::builder(fl!("syntax-dark")).control(
widget::dropdown( widget::dropdown::popup_dropdown(
&self.theme_names_dark, &self.theme_names_dark,
dark_selected, dark_selected,
move |theme_i| { move |theme_i| {
@ -952,6 +954,9 @@ impl App {
theme_i, theme_i,
) )
}, },
self.core.main_window_id().unwrap_or(window::Id::RESERVED),
Message::Surface,
|a| a,
), ),
), ),
) )
@ -1962,7 +1967,10 @@ impl Application for App {
if let Ok(value) = shlex::try_join(data.paths.iter().filter_map(|p| p.to_str())) { if let Ok(value) = shlex::try_join(data.paths.iter().filter_map(|p| p.to_str())) {
return Task::batch([ return Task::batch([
self.update_focus(), self.update_focus(),
command::message::app(Message::PasteValue(Some(entity), value)), cosmic::task::message(action::app(Message::PasteValue(
Some(entity),
value,
))),
]); ]);
} }
} }
@ -2025,8 +2033,8 @@ impl Application for App {
return Task::batch([ return Task::batch([
self.update_focus(), self.update_focus(),
clipboard::read_primary().map(move |value_opt| match value_opt { clipboard::read_primary().map(move |value_opt| match value_opt {
Some(value) => message::app(Message::PasteValue(entity_opt, value)), Some(value) => action::app(Message::PasteValue(entity_opt, value)),
None => message::none(), None => action::none(),
}), }),
]); ]);
} }
@ -2100,14 +2108,14 @@ impl Application for App {
Message::PaneDragged(_) => {} Message::PaneDragged(_) => {}
Message::Paste(entity_opt) => { Message::Paste(entity_opt) => {
return clipboard::read().map(move |value_opt| match value_opt { return clipboard::read().map(move |value_opt| match value_opt {
Some(value) => message::app(Message::PasteValue(entity_opt, value)), Some(value) => action::app(Message::PasteValue(entity_opt, value)),
None => message::none(), None => action::none(),
}); });
} }
Message::PastePrimary(entity_opt) => { Message::PastePrimary(entity_opt) => {
return clipboard::read_primary().map(move |value_opt| match value_opt { return clipboard::read_primary().map(move |value_opt| match value_opt {
Some(value) => message::app(Message::PasteValue(entity_opt, value)), Some(value) => action::app(Message::PasteValue(entity_opt, value)),
None => message::none(), None => action::none(),
}); });
} }
Message::PasteValue(entity_opt, value) => { Message::PasteValue(entity_opt, value) => {
@ -2408,7 +2416,7 @@ impl Application for App {
//TODO: what to do when data_opt is None? //TODO: what to do when data_opt is None?
callback(&data_opt.unwrap_or_default()); callback(&data_opt.unwrap_or_default());
// We don't need to do anything else // We don't need to do anything else
message::none() action::none()
}); });
} }
term::ClipboardType::Selection => { term::ClipboardType::Selection => {
@ -2600,6 +2608,11 @@ impl Application for App {
self.reset_terminal_panes_zoom(); self.reset_terminal_panes_zoom();
return self.update_config(); return self.update_config();
} }
Message::Surface(a) => {
return cosmic::task::message(cosmic::Action::Cosmic(
cosmic::app::Action::Surface(a),
));
}
} }
Task::none() Task::none()
@ -2725,10 +2738,12 @@ impl Application for App {
.on_input(Message::FindSearchValueChanged) .on_input(Message::FindSearchValueChanged)
// This is inverted for ease of use, usually in terminals you want to search // This is inverted for ease of use, usually in terminals you want to search
// upwards, which is FindPrevious // upwards, which is FindPrevious
.on_submit(if self.modifiers.contains(Modifiers::SHIFT) { .on_submit(|_| {
Message::FindNext if self.modifiers.contains(Modifiers::SHIFT) {
} else { Message::FindNext
Message::FindPrevious } else {
Message::FindPrevious
}
}) })
.width(Length::Fixed(320.0)) .width(Length::Fixed(320.0))
.trailing_icon( .trailing_icon(