kcapp: Make both the device and find device page look similar
Use ScrollablePage or drop paddings Don't add spacing between delegates
This commit is contained in:
parent
9bc9aba474
commit
db2e1af179
3 changed files with 35 additions and 32 deletions
|
@ -31,6 +31,10 @@ Kirigami.Page
|
|||
title: currentDevice.name
|
||||
|
||||
actions.contextualActions: deviceLoader.item.actions
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Loader {
|
||||
id: deviceLoader
|
||||
|
@ -56,6 +60,7 @@ Kirigami.Page
|
|||
]
|
||||
|
||||
id: trustedView
|
||||
spacing: 0
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import QtQuick.Layouts 1.1
|
|||
import org.kde.kirigami 2.0 as Kirigami
|
||||
import org.kde.kdeconnect 1.0
|
||||
|
||||
Kirigami.Page
|
||||
Kirigami.ScrollablePage
|
||||
{
|
||||
Component {
|
||||
id: deviceComp
|
||||
|
@ -33,39 +33,37 @@ Kirigami.Page
|
|||
|
||||
objectName: "FindDevices"
|
||||
title: i18n("Pair")
|
||||
ScrollView {
|
||||
anchors.fill: parent
|
||||
ListView {
|
||||
section {
|
||||
property: "status"
|
||||
delegate: Label {
|
||||
text: switch (parseInt(section))
|
||||
{
|
||||
case DevicesModel.Paired:
|
||||
return i18n("Paired")
|
||||
case DevicesModel.Reachable:
|
||||
return i18n("Reachable")
|
||||
case (DevicesModel.Reachable | DevicesModel.Paired):
|
||||
return i18n("Paired & Reachable")
|
||||
}
|
||||
|
||||
ListView {
|
||||
section {
|
||||
property: "status"
|
||||
delegate: Kirigami.Heading {
|
||||
level: 4
|
||||
text: switch (parseInt(section))
|
||||
{
|
||||
case DevicesModel.Paired:
|
||||
return i18n("Paired")
|
||||
case DevicesModel.Reachable:
|
||||
return i18n("Reachable")
|
||||
case (DevicesModel.Reachable | DevicesModel.Paired):
|
||||
return i18n("Paired & Reachable")
|
||||
}
|
||||
}
|
||||
|
||||
model: DevicesSortProxyModel {
|
||||
sourceModel: DevicesModel { displayFilter: DevicesModel.Reachable }
|
||||
}
|
||||
delegate: Kirigami.BasicListItem {
|
||||
width: ListView.view.width
|
||||
icon: iconName
|
||||
label: display + "\n" + toolTip
|
||||
enabled: !(status & DevicesModel.Paired)
|
||||
onClicked: {
|
||||
pageStack.push(
|
||||
deviceComp,
|
||||
{currentDevice: device}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
model: DevicesSortProxyModel {
|
||||
sourceModel: DevicesModel { displayFilter: DevicesModel.Reachable }
|
||||
}
|
||||
delegate: Kirigami.BasicListItem {
|
||||
width: ListView.view.width
|
||||
icon: iconName
|
||||
label: display + "\n" + toolTip
|
||||
enabled: !(status & DevicesModel.Paired)
|
||||
onClicked: {
|
||||
pageStack.push(
|
||||
deviceComp,
|
||||
{currentDevice: device}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ Kirigami.BasicListItem
|
|||
{
|
||||
property alias pluginName: checker.pluginName
|
||||
property var interfaceFactory
|
||||
property string component
|
||||
property var component
|
||||
|
||||
readonly property var checker: PluginChecker {
|
||||
id: checker
|
||||
|
|
Loading…
Reference in a new issue