chore: update libcosmic
This commit is contained in:
parent
91f252c882
commit
a4dd9ab142
3 changed files with 544 additions and 516 deletions
1009
Cargo.lock
generated
1009
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -61,6 +61,8 @@ wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"]
|
|||
[profile.release-with-debug]
|
||||
inherits = "release"
|
||||
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']
|
||||
# libcosmic = { path = "../libcosmic" }
|
||||
|
|
|
|||
49
src/main.rs
49
src/main.rs
|
|
@ -7,9 +7,9 @@ use cosmic::iced::clipboard::dnd::DndAction;
|
|||
use cosmic::widget::menu::action::MenuAction;
|
||||
use cosmic::widget::menu::key_bind::KeyBind;
|
||||
use cosmic::widget::DndDestination;
|
||||
use cosmic::Apply;
|
||||
use cosmic::{
|
||||
app::{command, context_drawer, message, Core, Settings, Task},
|
||||
action,
|
||||
app::{context_drawer, Core, Settings, Task},
|
||||
cosmic_config::{self, ConfigSet, CosmicConfigEntry},
|
||||
cosmic_theme, executor,
|
||||
iced::{
|
||||
|
|
@ -25,6 +25,7 @@ use cosmic::{
|
|||
widget::{self, button, pane_grid, segmented_button, PaneGrid},
|
||||
Application, ApplicationExt, Element,
|
||||
};
|
||||
use cosmic::{surface, Apply};
|
||||
use cosmic_files::dialog::{Dialog, DialogKind, DialogMessage, DialogResult};
|
||||
use cosmic_text::{fontdb::FaceInfo, Family, Stretch, Weight};
|
||||
use localize::LANGUAGE_SORTER;
|
||||
|
|
@ -338,6 +339,7 @@ pub enum Message {
|
|||
ProfileRemove(ProfileId),
|
||||
ProfileSyntaxTheme(ProfileId, ColorSchemeKind, usize),
|
||||
ProfileTabTitle(ProfileId, String),
|
||||
Surface(surface::Action),
|
||||
SelectAll(Option<segmented_button::Entity>),
|
||||
ShowAdvancedFontSettings(bool),
|
||||
ShowHeaderBar(bool),
|
||||
|
|
@ -514,7 +516,7 @@ impl App {
|
|||
self.core.window.show_headerbar = self.config.show_headerbar;
|
||||
|
||||
// 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> {
|
||||
|
|
@ -790,7 +792,7 @@ impl App {
|
|||
value,
|
||||
)
|
||||
})
|
||||
.on_submit(Message::ColorSchemeRenameSubmit)
|
||||
.on_submit(|_| Message::ColorSchemeRenameSubmit)
|
||||
.into(),
|
||||
popover.into(),
|
||||
]),
|
||||
|
|
@ -942,7 +944,7 @@ impl App {
|
|||
.add(
|
||||
//TODO: rename to color-scheme-dark?
|
||||
widget::settings::item::builder(fl!("syntax-dark")).control(
|
||||
widget::dropdown(
|
||||
widget::dropdown::popup_dropdown(
|
||||
&self.theme_names_dark,
|
||||
dark_selected,
|
||||
move |theme_i| {
|
||||
|
|
@ -952,6 +954,9 @@ impl App {
|
|||
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())) {
|
||||
return Task::batch([
|
||||
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([
|
||||
self.update_focus(),
|
||||
clipboard::read_primary().map(move |value_opt| match value_opt {
|
||||
Some(value) => message::app(Message::PasteValue(entity_opt, value)),
|
||||
None => message::none(),
|
||||
Some(value) => action::app(Message::PasteValue(entity_opt, value)),
|
||||
None => action::none(),
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
|
@ -2100,14 +2108,14 @@ impl Application for App {
|
|||
Message::PaneDragged(_) => {}
|
||||
Message::Paste(entity_opt) => {
|
||||
return clipboard::read().map(move |value_opt| match value_opt {
|
||||
Some(value) => message::app(Message::PasteValue(entity_opt, value)),
|
||||
None => message::none(),
|
||||
Some(value) => action::app(Message::PasteValue(entity_opt, value)),
|
||||
None => action::none(),
|
||||
});
|
||||
}
|
||||
Message::PastePrimary(entity_opt) => {
|
||||
return clipboard::read_primary().map(move |value_opt| match value_opt {
|
||||
Some(value) => message::app(Message::PasteValue(entity_opt, value)),
|
||||
None => message::none(),
|
||||
Some(value) => action::app(Message::PasteValue(entity_opt, value)),
|
||||
None => action::none(),
|
||||
});
|
||||
}
|
||||
Message::PasteValue(entity_opt, value) => {
|
||||
|
|
@ -2408,7 +2416,7 @@ impl Application for App {
|
|||
//TODO: what to do when data_opt is None?
|
||||
callback(&data_opt.unwrap_or_default());
|
||||
// We don't need to do anything else
|
||||
message::none()
|
||||
action::none()
|
||||
});
|
||||
}
|
||||
term::ClipboardType::Selection => {
|
||||
|
|
@ -2600,6 +2608,11 @@ impl Application for App {
|
|||
self.reset_terminal_panes_zoom();
|
||||
return self.update_config();
|
||||
}
|
||||
Message::Surface(a) => {
|
||||
return cosmic::task::message(cosmic::Action::Cosmic(
|
||||
cosmic::app::Action::Surface(a),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Task::none()
|
||||
|
|
@ -2725,10 +2738,12 @@ impl Application for App {
|
|||
.on_input(Message::FindSearchValueChanged)
|
||||
// This is inverted for ease of use, usually in terminals you want to search
|
||||
// upwards, which is FindPrevious
|
||||
.on_submit(if self.modifiers.contains(Modifiers::SHIFT) {
|
||||
Message::FindNext
|
||||
} else {
|
||||
Message::FindPrevious
|
||||
.on_submit(|_| {
|
||||
if self.modifiers.contains(Modifiers::SHIFT) {
|
||||
Message::FindNext
|
||||
} else {
|
||||
Message::FindPrevious
|
||||
}
|
||||
})
|
||||
.width(Length::Fixed(320.0))
|
||||
.trailing_icon(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue