Fix compilation with new cosmic-files dialog API
This commit is contained in:
parent
b1c80a7f3c
commit
863f570b56
2 changed files with 13 additions and 12 deletions
23
src/main.rs
23
src/main.rs
|
|
@ -23,7 +23,7 @@ use cosmic::{
|
||||||
Application, ApplicationExt, Apply, Element,
|
Application, ApplicationExt, Apply, Element,
|
||||||
};
|
};
|
||||||
use cosmic_files::{
|
use cosmic_files::{
|
||||||
dialog::{Dialog, DialogKind, DialogMessage, DialogResult},
|
dialog::{Dialog, DialogKind, DialogMessage, DialogResult, DialogSettings},
|
||||||
mime_icon::{mime_for_path, mime_icon},
|
mime_icon::{mime_for_path, mime_icon},
|
||||||
};
|
};
|
||||||
use cosmic_text::{Cursor, Edit, Family, Selection, SwashCache, SyntaxSystem, ViMode};
|
use cosmic_text::{Cursor, Edit, Family, Selection, SwashCache, SyntaxSystem, ViMode};
|
||||||
|
|
@ -2090,8 +2090,7 @@ impl Application for App {
|
||||||
Message::OpenFileDialog => {
|
Message::OpenFileDialog => {
|
||||||
if self.dialog_opt.is_none() {
|
if self.dialog_opt.is_none() {
|
||||||
let (dialog, command) = Dialog::new(
|
let (dialog, command) = Dialog::new(
|
||||||
DialogKind::OpenMultipleFiles,
|
DialogSettings::new().kind(DialogKind::OpenMultipleFiles),
|
||||||
None,
|
|
||||||
Message::DialogMessage,
|
Message::DialogMessage,
|
||||||
Message::OpenFileResult,
|
Message::OpenFileResult,
|
||||||
);
|
);
|
||||||
|
|
@ -2164,8 +2163,7 @@ impl Application for App {
|
||||||
Message::OpenProjectDialog => {
|
Message::OpenProjectDialog => {
|
||||||
if self.dialog_opt.is_none() {
|
if self.dialog_opt.is_none() {
|
||||||
let (dialog, command) = Dialog::new(
|
let (dialog, command) = Dialog::new(
|
||||||
DialogKind::OpenMultipleFolders,
|
DialogSettings::new().kind(DialogKind::OpenMultipleFolders),
|
||||||
None,
|
|
||||||
Message::DialogMessage,
|
Message::DialogMessage,
|
||||||
Message::OpenProjectResult,
|
Message::OpenProjectResult,
|
||||||
);
|
);
|
||||||
|
|
@ -2390,12 +2388,15 @@ impl Application for App {
|
||||||
),
|
),
|
||||||
None => (String::new(), None),
|
None => (String::new(), None),
|
||||||
};
|
};
|
||||||
let (dialog, command) = Dialog::new(
|
let mut settings =
|
||||||
DialogKind::SaveFile { filename },
|
DialogSettings::new().kind(DialogKind::SaveFile { filename });
|
||||||
path_opt,
|
if let Some(path) = path_opt {
|
||||||
Message::DialogMessage,
|
settings = settings.path(path);
|
||||||
move |result| Message::SaveAsResult(entity, result),
|
}
|
||||||
);
|
let (dialog, command) =
|
||||||
|
Dialog::new(settings, Message::DialogMessage, move |result| {
|
||||||
|
Message::SaveAsResult(entity, result)
|
||||||
|
});
|
||||||
self.dialog_opt = Some(dialog);
|
self.dialog_opt = Some(dialog);
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ use cosmic::{
|
||||||
theme,
|
theme,
|
||||||
widget::{
|
widget::{
|
||||||
self, divider, horizontal_space,
|
self, divider, horizontal_space,
|
||||||
menu::{menu_button, ItemHeight, ItemWidth, MenuBar, Tree as MenuTree},
|
menu::{menu_button, ItemHeight, ItemWidth},
|
||||||
responsive_menu_bar, segmented_button,
|
responsive_menu_bar, segmented_button,
|
||||||
},
|
},
|
||||||
Element,
|
Element,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue