mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-11-30 09:34:29 +00:00
improved preview
This commit is contained in:
1 parent
b64c192c4f
commit
9033401094
11 files changed
+109
-4
No files matched your search
@@ -450,6 +450,17 @@ impl Workspace {
|
||||
closed.merge(opened)
|
||||
}
|
||||
|
||||
/// Closes the preview when something else is selected (not nothing, nor something in it): it was
|
||||
/// only looked at. Says what changed in the engine, `None` if it stays.
|
||||
pub fn drop_preview(&mut self, engine: &mut Engine) -> Option<api::Outcome> {
|
||||
let id = self.preview?;
|
||||
let selected = engine.selection().file_ids();
|
||||
if selected.is_empty() || selected.contains(&FileId(id)) {
|
||||
return None;
|
||||
}
|
||||
Some(self.close_files(engine, &[id], false))
|
||||
}
|
||||
|
||||
/// The files are open for good: none of them is the preview anymore.
|
||||
pub fn keep(&mut self, ids: &[Uuid]) {
|
||||
if self.preview.is_some_and(|preview| ids.contains(&preview)) {
|
||||
|
||||
Reference in new issue
Block a user