Port DevicesPage to FormCard
This commit is contained in:
@@ -7,11 +7,11 @@ import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.19 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
MobileForm.AbstractFormDelegate {
|
||||
FormCard.AbstractFormDelegate {
|
||||
id: deviceDelegate
|
||||
|
||||
required property string id
|
||||
@@ -21,8 +21,6 @@ MobileForm.AbstractFormDelegate {
|
||||
property bool editDeviceName: false
|
||||
property bool showVerifyButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
onClicked: deviceDelegate.editDeviceName = true
|
||||
|
||||
contentItem: RowLayout {
|
||||
|
||||
@@ -6,7 +6,7 @@ import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.19 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
@@ -18,20 +18,14 @@ ColumnLayout {
|
||||
required property bool showVerifyButton
|
||||
|
||||
visible: deviceRepeater.count > 0
|
||||
MobileForm.FormHeader {
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: root.title
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
id: devicesCard
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
Repeater {
|
||||
id: deviceRepeater
|
||||
model: DevicesProxyModel {
|
||||
@@ -49,7 +43,7 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,26 +7,22 @@ import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.19 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
FormCard.FormCardPage {
|
||||
id: root
|
||||
|
||||
title: i18n("Devices")
|
||||
|
||||
required property NeoChatConnection connection
|
||||
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
|
||||
DevicesModel {
|
||||
property DevicesModel devicesModel: DevicesModel {
|
||||
id: devicesModel
|
||||
connection: root.connection
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
DevicesCard {
|
||||
title: i18n("This Device")
|
||||
type: DevicesModel.This
|
||||
@@ -48,7 +44,7 @@ Kirigami.ScrollablePage {
|
||||
showVerifyButton: false
|
||||
}
|
||||
|
||||
MobileForm.AbstractFormDelegate {
|
||||
FormCard.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
visible: Controller.activeConnection && devicesModel.count === 0 // We can assume 0 means loading since there is at least one device
|
||||
contentItem: Kirigami.LoadingPlaceholder { }
|
||||
@@ -62,9 +58,8 @@ Kirigami.ScrollablePage {
|
||||
type: Kirigami.MessageType.Information
|
||||
visible: !Controller.activeConnection
|
||||
}
|
||||
}
|
||||
|
||||
Kirigami.OverlaySheet {
|
||||
property Kirigami.OverlaySheet passwordSheet: Kirigami.OverlaySheet {
|
||||
id: passwordSheet
|
||||
|
||||
property string deviceId
|
||||
|
||||
Reference in New Issue
Block a user