Port away from Kirigami BasicListItem
It doesn't exist any more in KF6
This commit is contained in:
parent
4caf77445f
commit
7fcafdf12e
5 changed files with 36 additions and 21 deletions
|
@ -57,7 +57,7 @@ ecm_set_disabled_deprecation_versions(
|
|||
add_library(kdeconnectversion INTERFACE)
|
||||
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons DocTools)
|
||||
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami People WindowSystem GuiAddons DocTools)
|
||||
|
||||
set_package_properties(KF${QT_MAJOR_VERSION}Kirigami2 PROPERTIES
|
||||
DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"
|
||||
|
|
|
@ -46,11 +46,12 @@ Kirigami.ScrollablePage {
|
|||
|
||||
ListView {
|
||||
model: plugins
|
||||
delegate: Kirigami.BasicListItem {
|
||||
label: name
|
||||
@KIRIGAMI_ICON@: iconName
|
||||
delegate: QQC2.ItemDelegate {
|
||||
text: name
|
||||
icon.name: iconName
|
||||
highlighted: false
|
||||
iconColor: "transparent"
|
||||
icon.color: "transparent"
|
||||
width: ListView.view.width
|
||||
visible: loaded
|
||||
onClicked: onClick()
|
||||
}
|
||||
|
|
|
@ -60,12 +60,20 @@ Kirigami.ScrollablePage
|
|||
model: DevicesSortProxyModel {
|
||||
sourceModel: DevicesModel {}
|
||||
}
|
||||
delegate: Kirigami.BasicListItem {
|
||||
@KIRIGAMI_ICON@: iconName
|
||||
iconColor: "transparent"
|
||||
label: model.name
|
||||
subtitle: toolTip
|
||||
delegate: ItemDelegate {
|
||||
id: delegate
|
||||
icon.name: iconName
|
||||
icon.color: "transparent"
|
||||
text: model.name
|
||||
width: ListView.view.width
|
||||
highlighted: false
|
||||
|
||||
contentItem: Kirigami.IconTitleSubtitle {
|
||||
title: delegate.text
|
||||
subtitle: toolTip
|
||||
icon: icon.fromControlsIcon(delegate.icon)
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
pageStack.push(
|
||||
deviceComp,
|
||||
|
|
|
@ -68,10 +68,10 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Kirigami.BasicListItem {
|
||||
QQC2.ItemDelegate {
|
||||
id: findDevicesAction
|
||||
text: i18nd("kdeconnect-app", "Find devices...")
|
||||
@KIRIGAMI_ICON@: "list-add"
|
||||
icon.name: "list-add"
|
||||
checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices"
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
@ -92,13 +92,13 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Kirigami.BasicListItem {
|
||||
QQC2.ItemDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: model.name + "\n" + toolTip
|
||||
enabled: status & DevicesModel.Reachable
|
||||
checked: pageStack.currentItem && pageStack.currentItem.currentDevice == device
|
||||
@KIRIGAMI_ICON@: model.iconName
|
||||
iconColor: "transparent"
|
||||
icon.name: model.iconName
|
||||
icon.color: "transparent"
|
||||
onClicked: {
|
||||
root.pageStack.clear()
|
||||
root.pageStack.push(
|
||||
|
@ -114,9 +114,10 @@ Kirigami.ApplicationWindow {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Kirigami.BasicListItem {
|
||||
QQC2.ItemDelegate {
|
||||
text: i18n("Settings")
|
||||
@KIRIGAMI_ICON@: "settings-configure"
|
||||
icon.name: "settings-configure"
|
||||
Layout.fillWidth: true
|
||||
onClicked: pageStack.pushDialogLayer('qrc:/qml/Settings.qml', {}, {
|
||||
title: i18n("Settings"),
|
||||
});
|
||||
|
|
|
@ -30,12 +30,17 @@ Kirigami.ScrollablePage
|
|||
model: RemoteCommandsModel {
|
||||
deviceId: pluginInterface.deviceId
|
||||
}
|
||||
delegate: Kirigami.BasicListItem {
|
||||
delegate: ItemDelegate {
|
||||
id: delegate
|
||||
width: ListView.view.width
|
||||
label: name
|
||||
subtitle: command
|
||||
text: name
|
||||
|
||||
contentItem: Kirigami.TitleSubtitle {
|
||||
title: delegate.text
|
||||
subtitle: command
|
||||
}
|
||||
|
||||
onClicked: pluginInterface.triggerCommand(key)
|
||||
reserveSpaceForIcon: false
|
||||
}
|
||||
|
||||
Kirigami.PlaceholderMessage {
|
||||
|
|
Loading…
Reference in a new issue