diff --git a/CMakeLists.txt b/CMakeLists.txt index d78c4f7d..48075fa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,9 @@ install(DIRECTORY compositor/ PATTERN Messages.sh EXCLUDE PATTERN dummydata EXCLUDE) +kpackage_install_package(phonebook org.kde.phone.phonebook genericqml) +install(FILES phonebook/metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.phone.dialer.desktop) + add_subdirectory(bin) add_subdirectory(qmlcomponents) add_subdirectory(services) diff --git a/dialer/package/contents/ui/Dialer/Contacts.qml b/dialer/package/contents/ui/Dialer/Contacts.qml index 541aec5a..20d9ba70 100644 --- a/dialer/package/contents/ui/Dialer/Contacts.qml +++ b/dialer/package/contents/ui/Dialer/Contacts.qml @@ -19,12 +19,110 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 +import org.kde.people 1.0 as KPeople +import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras Item { PlasmaComponents.Label { anchors.centerIn: parent text: i18n("No contacts") + visible: contactsModel.count == 0 } -} \ No newline at end of file + + ColumnLayout { + anchors.fill: parent + //visible: contactsModel.count > 0 + + PlasmaComponents.ToolBar { + Layout.fillWidth: true + tools: RowLayout { + id: toolBarLayout + PlasmaComponents.TextField { + id: searchField + clearButtonShown: true + Layout.fillWidth: true + Layout.fillHeight: true + placeholderText: i18n("Search...") + } + } + } + + PlasmaExtras.ScrollArea { + Layout.fillWidth: true + Layout.fillHeight: true + ListView { + id: view + model: PlasmaCore.SortFilterModel { + id: filterModel + sourceModel: KPeople.PersonsModel { + id: contactsModel + } + sortRole: "display" + filterRole: "display" + filterRegExp: ".*"+searchField.text+".*" + sortOrder: Qt.AscendingOrder + } + section { + property: "display" + criteria: ViewSection.FirstCharacter + delegate: PlasmaComponents.ListItem { + id: sectionItem + sectionDelegate: true + PlasmaComponents.Label { + text: section + } + } + } + delegate: PlasmaComponents.ListItem { + RowLayout { + id: delegateLayout + + KQuickControlsAddons.QPixmapItem { + id: avatarLabel + + Layout.minimumWidth: units.iconSizes.medium + Layout.maximumWidth: Layout.minimumWidth + Layout.minimumHeight: Layout.minimumWidth + Layout.maximumHeight: Layout.minimumWidth + + pixmap: model.decoration + fillMode: ExtraComponents.QPixmapItem.PreserveAspectFit + smooth: true + } + + ColumnLayout { + Layout.fillHeight: true + Layout.fillWidth: true + + PlasmaComponents.Label { + id: nickLabel + + Layout.fillWidth: true + + text: model.display + elide: Text.ElideRight + } + + PlasmaComponents.Label { + id: dataLabel + + Layout.fillWidth: true + + text: "605-909-123" + elide: Text.ElideRight + } + + } + } + MouseArea { + anchors.fill: parent + onClicked: call(12345) + } + } + } + } + } +}