Scroll to focused item on tab rescan, fixes #1281
This commit is contained in:
parent
eaa756182a
commit
5edeea69f9
2 changed files with 21 additions and 2 deletions
15
src/app.rs
15
src/app.rs
|
|
@ -4153,10 +4153,19 @@ impl Application for App {
|
|||
tab.sort_name = sort.0;
|
||||
tab.sort_direction = sort.1;
|
||||
|
||||
let mut tasks = Vec::with_capacity(2);
|
||||
|
||||
if let Some(selection_paths) = selection_paths {
|
||||
tab.select_paths(selection_paths);
|
||||
|
||||
// Ensure selected path is scrolled to after redraw
|
||||
tasks.push(Task::done(cosmic::action::app(Message::TabMessage(
|
||||
Some(entity),
|
||||
tab::Message::ScrollToFocused,
|
||||
))));
|
||||
}
|
||||
return clipboard::read_data::<ClipboardPaste>().map(|p| {
|
||||
|
||||
tasks.push(clipboard::read_data::<ClipboardPaste>().map(|p| {
|
||||
cosmic::action::app(Message::CutPaths(match p {
|
||||
Some(s) => match s.kind {
|
||||
ClipboardKind::Copy => Vec::new(),
|
||||
|
|
@ -4164,7 +4173,9 @@ impl Application for App {
|
|||
},
|
||||
None => Vec::new(),
|
||||
}))
|
||||
});
|
||||
}));
|
||||
|
||||
return Task::batch(tasks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue