Port away from Kirigami BasicListItem

It doesn't exist any more in KF6
This commit is contained in:
Nicolas Fella 2023-11-14 23:48:56 +01:00
parent 4caf77445f
commit 7fcafdf12e
5 changed files with 36 additions and 21 deletions

View file

@ -57,7 +57,7 @@ ecm_set_disabled_deprecation_versions(
add_library(kdeconnectversion INTERFACE) add_library(kdeconnectversion INTERFACE)
target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR}) 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 set_package_properties(KF${QT_MAJOR_VERSION}Kirigami2 PROPERTIES
DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines" DESCRIPTION "QtQuick plugins to build user interfaces based on KDE UX guidelines"

View file

@ -46,11 +46,12 @@ Kirigami.ScrollablePage {
ListView { ListView {
model: plugins model: plugins
delegate: Kirigami.BasicListItem { delegate: QQC2.ItemDelegate {
label: name text: name
@KIRIGAMI_ICON@: iconName icon.name: iconName
highlighted: false highlighted: false
iconColor: "transparent" icon.color: "transparent"
width: ListView.view.width
visible: loaded visible: loaded
onClicked: onClick() onClicked: onClick()
} }

View file

@ -60,12 +60,20 @@ Kirigami.ScrollablePage
model: DevicesSortProxyModel { model: DevicesSortProxyModel {
sourceModel: DevicesModel {} sourceModel: DevicesModel {}
} }
delegate: Kirigami.BasicListItem { delegate: ItemDelegate {
@KIRIGAMI_ICON@: iconName id: delegate
iconColor: "transparent" icon.name: iconName
label: model.name icon.color: "transparent"
subtitle: toolTip text: model.name
width: ListView.view.width
highlighted: false highlighted: false
contentItem: Kirigami.IconTitleSubtitle {
title: delegate.text
subtitle: toolTip
icon: icon.fromControlsIcon(delegate.icon)
}
onClicked: { onClicked: {
pageStack.push( pageStack.push(
deviceComp, deviceComp,

View file

@ -68,10 +68,10 @@ Kirigami.ApplicationWindow {
} }
} }
Kirigami.BasicListItem { QQC2.ItemDelegate {
id: findDevicesAction id: findDevicesAction
text: i18nd("kdeconnect-app", "Find devices...") text: i18nd("kdeconnect-app", "Find devices...")
@KIRIGAMI_ICON@: "list-add" icon.name: "list-add"
checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices" checked: pageStack.currentItem && pageStack.currentItem.objectName == "FindDevices"
Layout.fillWidth: true Layout.fillWidth: true
@ -92,13 +92,13 @@ Kirigami.ApplicationWindow {
} }
} }
Kirigami.BasicListItem { QQC2.ItemDelegate {
Layout.fillWidth: true Layout.fillWidth: true
text: model.name + "\n" + toolTip text: model.name + "\n" + toolTip
enabled: status & DevicesModel.Reachable enabled: status & DevicesModel.Reachable
checked: pageStack.currentItem && pageStack.currentItem.currentDevice == device checked: pageStack.currentItem && pageStack.currentItem.currentDevice == device
@KIRIGAMI_ICON@: model.iconName icon.name: model.iconName
iconColor: "transparent" icon.color: "transparent"
onClicked: { onClicked: {
root.pageStack.clear() root.pageStack.clear()
root.pageStack.push( root.pageStack.push(
@ -114,9 +114,10 @@ Kirigami.ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
} }
Kirigami.BasicListItem { QQC2.ItemDelegate {
text: i18n("Settings") text: i18n("Settings")
@KIRIGAMI_ICON@: "settings-configure" icon.name: "settings-configure"
Layout.fillWidth: true
onClicked: pageStack.pushDialogLayer('qrc:/qml/Settings.qml', {}, { onClicked: pageStack.pushDialogLayer('qrc:/qml/Settings.qml', {}, {
title: i18n("Settings"), title: i18n("Settings"),
}); });

View file

@ -30,12 +30,17 @@ Kirigami.ScrollablePage
model: RemoteCommandsModel { model: RemoteCommandsModel {
deviceId: pluginInterface.deviceId deviceId: pluginInterface.deviceId
} }
delegate: Kirigami.BasicListItem { delegate: ItemDelegate {
id: delegate
width: ListView.view.width width: ListView.view.width
label: name text: name
subtitle: command
contentItem: Kirigami.TitleSubtitle {
title: delegate.text
subtitle: command
}
onClicked: pluginInterface.triggerCommand(key) onClicked: pluginInterface.triggerCommand(key)
reserveSpaceForIcon: false
} }
Kirigami.PlaceholderMessage { Kirigami.PlaceholderMessage {