Skip to content

Commit

Permalink
Remember scrolling position when navigating though file browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Jan 9, 2025
1 parent c95529d commit a34d93e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tray/gui/qml/FilesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Page {
const modelIndex = delegateModel.modelIndex(index);
if (delegateModel.model.hasChildren(modelIndex)) {
delegateModel.rootIndex = modelIndex;
listView.positionViewAtBeginning();
} else {
itemDelegate.toggle();
}
Expand Down Expand Up @@ -156,9 +157,12 @@ Page {
property var extraActions: []

function back() {
const isValid = delegateModel.rootIndex.valid;
const rootIndex = delegateModel.rootIndex;
const isValid = rootIndex.valid;
if (isValid) {
const parentRow = rootIndex.row;
delegateModel.rootIndex = delegateModel.parentModelIndex();
listView.positionViewAtIndex(parentRow, ListView.Center);
}
return isValid;
}
Expand Down

0 comments on commit a34d93e

Please sign in to comment.