From kde-commits Thu Apr 21 02:56:25 2016 From: Martin Klapetek Date: Thu, 21 Apr 2016 02:56:25 +0000 To: kde-commits Subject: [spacebar] app/package/contents/ui: Get rid of remaining PlasmaComponents usage Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=146120739406474 Git commit ae0081a8c31809b883afbfe0483137044fa5233d by Martin Klapetek. Committed on 21/04/2016 at 02:56. Pushed by mklapetek into branch 'master'. Get rid of remaining PlasmaComponents usage M +2 -4 app/package/contents/ui/ActionDelegate.qml M +70 -66 app/package/contents/ui/ContactList.qml M +2 -3 app/package/contents/ui/ConversationPage.qml M +2 -2 app/package/contents/ui/NewConversationPage.qml M +0 -1 app/package/contents/ui/main.qml http://commits.kde.org/spacebar/ae0081a8c31809b883afbfe0483137044fa5233d diff --git a/app/package/contents/ui/ActionDelegate.qml b/app/package/conte= nts/ui/ActionDelegate.qml index df9fbc3..ef03df1 100644 --- a/app/package/contents/ui/ActionDelegate.qml +++ b/app/package/contents/ui/ActionDelegate.qml @@ -18,11 +18,9 @@ */ = import QtQuick 2.1 -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.telepathy 0.1 +import org.kde.kirigami 1.0 as Kirigami = -PlasmaComponents.Label { +Kirigami.Label { wrapMode: Text.Wrap width: view.width text: "* " + model.senderAlias + " " + model.text + "" diff --git a/app/package/contents/ui/ContactList.qml b/app/package/contents= /ui/ContactList.qml index 85d6785..a18fb31 100644 --- a/app/package/contents/ui/ContactList.qml +++ b/app/package/contents/ui/ContactList.qml @@ -24,10 +24,7 @@ import org.kde.people 1.0 as KPeople import org.kde.plasma.private.kpeoplehelper 1.0 import org.kde.kquickcontrolsaddons 2.0 as ExtraComponents import org.kde.plasma.core 2.1 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.mobilecomponents 0.2 as MobileComponents import org.kde.kirigami 1.0 as Kirigami -import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.telepathy 0.1 = ListView { @@ -62,9 +59,9 @@ ListView { = boundsBehavior: Flickable.StopAtBounds // highlightRangeMode: ListView.ApplyRange - highlight: PlasmaComponents.Highlight { - - } +// highlight: PlasmaComponents.Highlight { +// +// } highlightMoveDuration: 0 = KPeople.PersonActions { @@ -73,7 +70,8 @@ ListView { = onCurrentIndexChanged: print("---> " + currentIndex); = - delegate: PlasmaComponents.ListItem { + delegate: Kirigami.AbstractListItem { + supportsMouseEvents: true height: actionsRow.visible ? units.gridUnit * 6 : units.gridUnit *= 3 enabled: true clip: true @@ -87,92 +85,98 @@ ListView { } else { actionsListProxy.sourceModel =3D personActionsModel; } - } = - // Clear the actions model when index is switched - Connections { - target: contactsList - onCurrentIndexChanged: { - if (contactsList.currentIndex !=3D index) { - actionsListProxy.sourceModel =3D null; - } - } + contactsList.contactClicked(model.personUri); } = - ColumnLayout { + Item { anchors.fill: parent = - RowLayout { - id: mainLayout - Layout.fillHeight: true - Layout.maximumHeight: units.gridUnit * 3 - Layout.fillWidth: true + // Clear the actions model when index is switched + Connections { + target: contactsList + onCurrentIndexChanged: { + if (contactsList.currentIndex !=3D index) { + actionsListProxy.sourceModel =3D null; + } + } + } = - ExtraComponents.QPixmapItem { - id: avatarLabel + ColumnLayout { + anchors.fill: parent = - Layout.maximumWidth: parent.height - Layout.minimumWidth: parent.height + RowLayout { + id: mainLayout Layout.fillHeight: true + Layout.maximumHeight: units.gridUnit * 3 + Layout.fillWidth: true = - pixmap: model.decoration - fillMode: ExtraComponents.QPixmapItem.PreserveAspectFit - smooth: true - } + ExtraComponents.QPixmapItem { + id: avatarLabel = - ColumnLayout { - Layout.fillHeight: true - Layout.fillWidth: true + Layout.maximumWidth: parent.height + Layout.minimumWidth: parent.height + Layout.fillHeight: true = - Kirigami.Label { - id: nickLabel + pixmap: model.decoration + fillMode: ExtraComponents.QPixmapItem.PreserveAspe= ctFit + smooth: true + } = + ColumnLayout { + Layout.fillHeight: true Layout.fillWidth: true = - text: model.display - elide: Text.ElideRight - } + Kirigami.Label { + id: nickLabel = - Kirigami.Label { - id: dataLabel + Layout.fillWidth: true = - Layout.fillWidth: true + text: model.display + elide: Text.ElideRight + } = - text: model.phoneNumber !=3D=3D undefined ? model.= phoneNumber : (model.accountDisplayName !=3D=3D undefined ? model.accountDi= splayName : "") - elide: Text.ElideRight - visible: dataLabel.text !=3D nickLabel.text - opacity: 0.4 - } + Kirigami.Label { + id: dataLabel = - } - } + Layout.fillWidth: true = - RowLayout { - id: actionsRow - Layout.fillWidth: true - Layout.fillHeight: true + text: model.phoneNumber !=3D=3D undefined ? mo= del.phoneNumber : (model.accountDisplayName !=3D=3D undefined ? model.accou= ntDisplayName : "") + elide: Text.ElideRight + visible: dataLabel.text !=3D nickLabel.text + opacity: 0.4 + } = - visible: actionsList.count > 0 + } + } = - ListView { - id: actionsList + RowLayout { + id: actionsRow Layout.fillWidth: true Layout.fillHeight: true - orientation: ListView.Horizontal = - model: PlasmaCore.SortFilterModel { - id: actionsListProxy - filterRole: "actionType" - filterCallback: function(source_row, value) { retu= rn value =3D=3D KPeople.ActionType.TextChatAction; } - } + visible: actionsList.count > 0 = - delegate: PlasmaComponents.Button { + ListView { + id: actionsList Layout.fillWidth: true - text: model.display - iconSource: model.iconName + Layout.fillHeight: true + orientation: ListView.Horizontal + + model: PlasmaCore.SortFilterModel { + id: actionsListProxy + filterRole: "actionType" + filterCallback: function(source_row, value) { = return value =3D=3D KPeople.ActionType.TextChatAction; } + } + + delegate: Button { + Layout.fillWidth: true + text: model.display + iconSource: model.iconName = - onClicked: { - personActionsModel.triggerAction(actionsListPr= oxy.mapRowToSource(index)); + onClicked: { + personActionsModel.triggerAction(actionsLi= stProxy.mapRowToSource(index)); + } } } } diff --git a/app/package/contents/ui/ConversationPage.qml b/app/package/con= tents/ui/ConversationPage.qml index 9369232..e4f9e01 100644 --- a/app/package/contents/ui/ConversationPage.qml +++ b/app/package/contents/ui/ConversationPage.qml @@ -21,7 +21,6 @@ import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.kirigami 1.0 as Kirigami import org.kde.plasma.extras 2.0 as PlasmaExtras // import org.kde.plasma.private.spacebar 1.0 @@ -100,7 +99,7 @@ Kirigami.Page { boundsBehavior: Flickable.StopAtBounds = section.property: "senderAlias" - section.delegate: PlasmaComponents.Label { + section.delegate: Kirigami.Label { anchors.right: parent.right anchors.left: parent.left height: paintedHeight * 1.5 @@ -196,7 +195,7 @@ Kirigami.Page { = RowLayout { = - PlasmaComponents.TextField { + TextField { id: messageTextField Layout.fillWidth: true = diff --git a/app/package/contents/ui/NewConversationPage.qml b/app/package/= contents/ui/NewConversationPage.qml index 2bf7fcc..59d72c4 100644 --- a/app/package/contents/ui/NewConversationPage.qml +++ b/app/package/contents/ui/NewConversationPage.qml @@ -21,7 +21,6 @@ import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import org.kde.plasma.private.kpeoplehelper 1.0 -import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.kirigami 1.0 as Kirigami import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.telepathy 0.1 @@ -47,7 +46,8 @@ Kirigami.Page { Layout.alignment: Qt.AlignRight text: i18n("To:") } - PlasmaComponents.TextField { + + TextField { id: toInputField Layout.alignment: Qt.AlignLeft Layout.fillWidth: true diff --git a/app/package/contents/ui/main.qml b/app/package/contents/ui/mai= n.qml index bba82f8..fac0ff0 100644 --- a/app/package/contents/ui/main.qml +++ b/app/package/contents/ui/main.qml @@ -21,7 +21,6 @@ import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.kirigami 1.0 as Kirigami = Kirigami.ApplicationWindow {