mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-18 17:55:03 +01:00
fix(gui): keep the user's place when navigating
A folder opened in My files, Shared with me or Computers kept the scroll offset of the folder before it, because the rows are swapped in place to keep a refresh steady. Another folder, a new search and a fresh Photos load (filter, album, place) now start at the top; a refresh still keeps its place. Closing a photo opened from the Places map returns to the map instead of leaving the town's timeline behind, and the pending open is dropped when the user leaves the town before it loads. load_gallery no longer swaps Albums or Places for the timeline when a page lands late (viewer paging, upload, trash Undo); the timeline is marked stale and read when the user switches back. Coming back to Photos reuses the timeline unless it is stale, and the timeline returns filtered the way the kind tabs and date show after an album or place. A search in My files is no longer replaced by the folder listing on file changes, F5 or returning to the page. A favorite set in the viewer shows on its tile at once.
This commit is contained in:
1 parent
57acb0b849
commit
6be8a8f9bc
11 files changed
+178
-21
No files matched your search
@@ -443,6 +443,7 @@ fn repaint_shared_files(ui: &Rc<Ui>, entries: &[DirEntry]) {
|
||||
let nav = ui.shared.nav.borrow().clone();
|
||||
repaint_shared_crumb(ui, &nav);
|
||||
let top = nav.is_empty();
|
||||
let another_folder = ui.shared.listed.borrow().as_ref() != Some(&nav);
|
||||
*ui.shared.listed.borrow_mut() = Some(nav);
|
||||
if entries.is_empty() {
|
||||
ui.shared.files.model.remove_all();
|
||||
@@ -467,8 +468,11 @@ fn repaint_shared_files(ui: &Rc<Ui>, entries: &[DirEntry]) {
|
||||
}
|
||||
ui.shared.files_content.set_visible_child_name("list");
|
||||
// Only the rows that changed are swapped, so a refresh keeps the selection
|
||||
// and the scroll position.
|
||||
// and the scroll position. Another folder starts from its first entry.
|
||||
replace_items(&ui.shared.files.model, entries);
|
||||
if another_folder {
|
||||
ui.shared.files.scroll_to_top();
|
||||
}
|
||||
}
|
||||
|
||||
/// Rebuild the breadcrumb trail for `nav`: "Shared with me", then each folder
|
||||
|
||||
Reference in new issue
Block a user