Add SwipeDelegateGroup in GenericDevicePage

This commit is contained in:
Michael Zanetti 2019-02-07 14:48:46 +01:00
parent 7d6986d683
commit 9b62184eec
3 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,8 @@ Item {
ScrollBar.vertical: ScrollBar {} ScrollBar.vertical: ScrollBar {}
SwipeDelegateGroup {}
onContentYChanged: { onContentYChanged: {
if (!engine.jsonRpcClient.ensureServerVersion("1.10")) { if (!engine.jsonRpcClient.ensureServerVersion("1.10")) {
if (!logsModel.busy && contentY - originY < 5 * height) { if (!logsModel.busy && contentY - originY < 5 * height) {

View File

@ -26,6 +26,7 @@ DeviceListPageBase {
ListView { ListView {
anchors.fill: parent anchors.fill: parent
model: root.devicesProxy model: root.devicesProxy
delegate: ThingDelegate { delegate: ThingDelegate {
width: parent.width width: parent.width
device: engine.deviceManager.devices.getDevice(model.id); device: engine.deviceManager.devices.getDevice(model.id);

View File

@ -21,6 +21,8 @@ DevicePageBase {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
SwipeDelegateGroup {}
section.property: "type" section.property: "type"
section.delegate: ListSectionHeader { section.delegate: ListSectionHeader {
text: { text: {
@ -82,7 +84,7 @@ DevicePageBase {
} }
} }
onClicked: pageStack.push(Qt.resolvedUrl("DeviceLogPage.qml"), {device: root.device, filterTypeIds: [model.id]}) onClicked: swipe.close()
swipe.right: RowLayout { swipe.right: RowLayout {
height: delegate.height height: delegate.height
@ -96,6 +98,7 @@ DevicePageBase {
name: "../images/logs.svg" name: "../images/logs.svg"
} }
onClicked: { onClicked: {
swipe.close();
pageStack.push(Qt.resolvedUrl("DeviceLogPage.qml"), {device: root.device, filterTypeIds: [model.id]}) pageStack.push(Qt.resolvedUrl("DeviceLogPage.qml"), {device: root.device, filterTypeIds: [model.id]})
} }
} }