1
0
Fork 0
mirror of https://github.com/seiichiro0185/sailotp.git synced 2024-11-24 16:19:43 +00:00

Move PullDownMenu into the SilicaListView

A `SilicaListView` will properly handle a child `PullDownMenu`.  It was
previously working when it was the child of a `SilicaFlickable`, but
since it was replaced by a `Column` it was not usable anymore.

Attaching the `PullDownMenu` to the `SilicaListView` instead of the
`SilicaFlickable`, it is properly hidden when the list of OTP is scroll
down and the menu cannot be operated by scrolling down.
This commit is contained in:
Romain Tartière 2024-09-29 18:46:49 -10:00
parent eb12a09f19
commit 3a7c2d83f5
No known key found for this signature in database
GPG key ID: BA4D1D955112336F

View file

@ -104,33 +104,32 @@ Page {
Column {
anchors.fill: parent
PullDownMenu {
MenuItem {
text: qsTr("About")
onClicked: pageStack.push(Qt.resolvedUrl("About.qml"))
}
MenuItem {
text: qsTr("Settings")
visible: true
onClicked: pageStack.push(Qt.resolvedUrl("Settings.qml"))
}
MenuItem {
text: qsTr("Export / Import")
onClicked: pageStack.push(Qt.resolvedUrl("ExportPage.qml"), {parentPage: mainPage, mode: "export"})
}
MenuItem {
text: qsTr("Add Token")
onClicked: pageStack.push(Qt.resolvedUrl("ScanOTP.qml"), {parentPage: mainPage})
}
}
SilicaListView {
id: otpList
model: appWin.listModel
height: parent.height - updateProgress.height - searchField.height
width: parent.width
PullDownMenu {
MenuItem {
text: qsTr("About")
onClicked: pageStack.push(Qt.resolvedUrl("About.qml"))
}
MenuItem {
text: qsTr("Settings")
visible: true
onClicked: pageStack.push(Qt.resolvedUrl("Settings.qml"))
}
MenuItem {
text: qsTr("Export / Import")
onClicked: pageStack.push(Qt.resolvedUrl("ExportPage.qml"), {parentPage: mainPage, mode: "export"})
}
MenuItem {
text: qsTr("Add Token")
onClicked: pageStack.push(Qt.resolvedUrl("ScanOTP.qml"), {parentPage: mainPage})
}
}
ViewPlaceholder {
enabled: otpList.count == 0
text: qsTr("Nothing here")