qml: apply long-press implementation also on ReceiveRequests
This commit is contained in:
@@ -44,6 +44,7 @@ Pane {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: true
|
clip: true
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
model: DelegateModel {
|
model: DelegateModel {
|
||||||
id: delegateModel
|
id: delegateModel
|
||||||
model: Daemon.currentWallet.invoiceModel
|
model: Daemon.currentWallet.invoiceModel
|
||||||
|
|||||||
@@ -12,70 +12,78 @@ import "controls"
|
|||||||
Pane {
|
Pane {
|
||||||
id: root
|
id: root
|
||||||
objectName: 'ReceiveRequests'
|
objectName: 'ReceiveRequests'
|
||||||
property string selected_key
|
|
||||||
|
padding: 0
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
InfoTextArea {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.bottomMargin: constants.paddingLarge
|
Layout.margins: constants.paddingLarge
|
||||||
visible: !Config.userKnowsPressAndHold
|
|
||||||
text: qsTr('To access this list from the main screen, press and hold the Receive button')
|
|
||||||
}
|
|
||||||
|
|
||||||
Heading {
|
InfoTextArea {
|
||||||
text: qsTr('Pending requests')
|
Layout.fillWidth: true
|
||||||
}
|
Layout.bottomMargin: constants.paddingLarge
|
||||||
|
visible: !Config.userKnowsPressAndHold
|
||||||
|
text: qsTr('To access this list from the main screen, press and hold the Receive button')
|
||||||
|
}
|
||||||
|
|
||||||
Frame {
|
Heading {
|
||||||
background: PaneInsetBackground {}
|
text: qsTr('Pending requests')
|
||||||
|
}
|
||||||
|
|
||||||
verticalPadding: 0
|
Frame {
|
||||||
horizontalPadding: 0
|
background: PaneInsetBackground {}
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
ListView {
|
verticalPadding: 0
|
||||||
id: listview
|
horizontalPadding: 0
|
||||||
anchors.fill: parent
|
Layout.fillHeight: true
|
||||||
clip: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
model: DelegateModel {
|
ListView {
|
||||||
id: delegateModel
|
id: listview
|
||||||
model: Daemon.currentWallet.requestModel
|
anchors.fill: parent
|
||||||
delegate: InvoiceDelegate {
|
clip: true
|
||||||
onClicked: {
|
currentIndex: -1
|
||||||
app.stack.getRoot().openRequest(model.key)
|
|
||||||
selected_key = ''
|
model: DelegateModel {
|
||||||
|
id: delegateModel
|
||||||
|
model: Daemon.currentWallet.requestModel
|
||||||
|
delegate: InvoiceDelegate {
|
||||||
|
onClicked: {
|
||||||
|
app.stack.getRoot().openRequest(model.key)
|
||||||
|
listview.currentIndex = -1
|
||||||
|
}
|
||||||
|
onPressAndHold: listview.currentIndex = index
|
||||||
}
|
}
|
||||||
onPressAndHold: {
|
|
||||||
selected_key = model.key
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
add: Transition {
|
|
||||||
NumberAnimation { properties: 'scale'; from: 0.75; to: 1; duration: 500 }
|
|
||||||
NumberAnimation { properties: 'opacity'; from: 0; to: 1; duration: 500 }
|
|
||||||
}
|
|
||||||
addDisplaced: Transition {
|
|
||||||
SpringAnimation { properties: 'y'; duration: 200; spring: 5; damping: 0.5; mass: 2 }
|
|
||||||
}
|
|
||||||
|
|
||||||
remove: Transition {
|
add: Transition {
|
||||||
NumberAnimation { properties: 'scale'; to: 0.75; duration: 300 }
|
NumberAnimation { properties: 'scale'; from: 0.75; to: 1; duration: 500 }
|
||||||
NumberAnimation { properties: 'opacity'; to: 0; duration: 300 }
|
NumberAnimation { properties: 'opacity'; from: 0; to: 1; duration: 500 }
|
||||||
}
|
}
|
||||||
removeDisplaced: Transition {
|
addDisplaced: Transition {
|
||||||
SequentialAnimation {
|
SpringAnimation { properties: 'y'; duration: 200; spring: 5; damping: 0.5; mass: 2 }
|
||||||
PauseAnimation { duration: 200 }
|
|
||||||
SpringAnimation { properties: 'y'; duration: 100; spring: 5; damping: 0.5; mass: 2 }
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ScrollIndicator.vertical: ScrollIndicator { }
|
remove: Transition {
|
||||||
|
NumberAnimation { properties: 'scale'; to: 0.75; duration: 300 }
|
||||||
|
NumberAnimation { properties: 'opacity'; to: 0; duration: 300 }
|
||||||
|
}
|
||||||
|
removeDisplaced: Transition {
|
||||||
|
SequentialAnimation {
|
||||||
|
PauseAnimation { duration: 200 }
|
||||||
|
SpringAnimation { properties: 'y'; duration: 100; spring: 5; damping: 0.5; mass: 2 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollIndicator.vertical: ScrollIndicator { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonContainer {
|
ButtonContainer {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
FlatButton {
|
FlatButton {
|
||||||
@@ -83,10 +91,9 @@ Pane {
|
|||||||
Layout.preferredWidth: 1
|
Layout.preferredWidth: 1
|
||||||
text: qsTr('Delete')
|
text: qsTr('Delete')
|
||||||
icon.source: '../../icons/delete.png'
|
icon.source: '../../icons/delete.png'
|
||||||
visible: selected_key != ''
|
visible: listview.currentIndex >= 0
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Daemon.currentWallet.delete_request(selected_key)
|
Daemon.currentWallet.delete_request(listview.currentItem.getKey())
|
||||||
selected_key = ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FlatButton {
|
FlatButton {
|
||||||
@@ -94,10 +101,9 @@ Pane {
|
|||||||
Layout.preferredWidth: 1
|
Layout.preferredWidth: 1
|
||||||
text: qsTr('View')
|
text: qsTr('View')
|
||||||
icon.source: '../../icons/tab_receive.png'
|
icon.source: '../../icons/tab_receive.png'
|
||||||
visible: selected_key != ''
|
visible: listview.currentIndex >= 0
|
||||||
onClicked: {
|
onClicked: {
|
||||||
app.stack.getRoot().openRequest(selected_key)
|
app.stack.getRoot().openRequest(listview.currentItem.getKey())
|
||||||
selected_key = ''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user