mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
QML UI: correctly handle back key on edits
This requires mobile components that include commit 03c868fc57e5 from earlier today. With this a single press on the back key cancels the edit and a second press on the back key brings you up one level in the page stack (usually back to the dive list). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ec9aad4487
commit
d43a2c032b
1 changed files with 7 additions and 0 deletions
|
@ -59,6 +59,13 @@ MobileComponents.Page {
|
|||
}
|
||||
}
|
||||
|
||||
onBackRequested: {
|
||||
if (state === "edit" || state === "add") {
|
||||
endEditMode();
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
function showDiveIndex(index) {
|
||||
currentIndex = index;
|
||||
diveDetailsListView.positionViewAtIndex(index, ListView.Beginning);
|
||||
|
|
Loading…
Add table
Reference in a new issue