Git commit 9674ba9a686c1e857ad810cad6f6f69e2f85c727 by Martin Klapetek. Committed on 14/05/2016 at 18:32. Pushed by mklapetek into branch 'master'. [app] Indentation cleanup M +70 -79 app/package/contents/ui/ConversationPage.qml http://commits.kde.org/spacebar/9674ba9a686c1e857ad810cad6f6f69e2f85c727 diff --git a/app/package/contents/ui/ConversationPage.qml b/app/package/con= tents/ui/ConversationPage.qml index 3be6ffe..95a636b 100644 --- a/app/package/contents/ui/ConversationPage.qml +++ b/app/package/contents/ui/ConversationPage.qml @@ -81,104 +81,95 @@ Kirigami.Page { opacity: 0.4 } = - // Flickable { - // id: conversationFlickable - // onAtYBeginningChanged: { - // if (conversationFlickable.atYBeginning) { - // - // } - // } - - ListView { - id: view - property bool followConversation: true + ListView { + id: view + property bool followConversation: true = - Layout.fillWidth: true - Layout.fillHeight: true - - boundsBehavior: Flickable.StopAtBounds - - section.property: "senderAlias" - section.delegate: Kirigami.Label { - anchors.right: parent.right - anchors.left: parent.left - height: paintedHeight * 1.5 - horizontalAlignment: section =3D=3D=3D conversatio= n.title ? Text.AlignLeft : Text.AlignRight - verticalAlignment: Text.AlignBottom - text: section - font.bold: true - } - clip: true + Layout.fillWidth: true + Layout.fillHeight: true + + boundsBehavior: Flickable.StopAtBounds + + section.property: "senderAlias" + section.delegate: Kirigami.Label { + anchors.right: parent.right + anchors.left: parent.left + height: paintedHeight * 1.5 + horizontalAlignment: section =3D=3D=3D conversation.ti= tle ? Text.AlignLeft : Text.AlignRight + verticalAlignment: Text.AlignBottom + text: section + font.bold: true + } + clip: true = - add: Transition { - id: addTrans - NumberAnimation { - properties: "x" - //FIXME: this doesn't seem to do what it should - from: addTrans.ViewTransition.item.isIncoming = ? -100 : 100 - duration: 60 + add: Transition { + id: addTrans + NumberAnimation { + properties: "x" + //FIXME: this doesn't seem to do what it should + from: addTrans.ViewTransition.item.isIncoming ? -1= 00 : 100 + duration: 60 = - } - PropertyAnimation { - properties: "opacity" - from: 0.0 - to: 1.0 - duration: 60 - } } + PropertyAnimation { + properties: "opacity" + from: 0.0 + to: 1.0 + duration: 60 + } + } = - //we need this so that scrolling down to the last elem= ent works properly - //this means that all the list is in memory - cacheBuffer: Math.max(0, contentHeight) - - delegate: Loader { - Component.onCompleted: { - switch (model.type) { - case MessagesModel.MessageTypeOutgoing: - case MessagesModel.MessageTypeIncoming: - source =3D "TextDelegate.qml" - break; - case MessagesModel.MessageTypeAction: - source =3D "ActionDelegate.qml"; - break; - } + //we need this so that scrolling down to the last element = works properly + //this means that all the list is in memory + cacheBuffer: Math.max(0, contentHeight) + + delegate: Loader { + Component.onCompleted: { + switch (model.type) { + case MessagesModel.MessageTypeOutgoing: + case MessagesModel.MessageTypeIncoming: + source =3D "TextDelegate.qml" + break; + case MessagesModel.MessageTypeAction: + source =3D "ActionDelegate.qml"; + break; } } + } = - model: conversation.messages + model: conversation.messages = - Connections { - target: conversation.messages + Connections { + target: conversation.messages = - onRowsInserted: { - if (view.followConversation) { - view.positionViewAtEnd(); - } + onRowsInserted: { + if (view.followConversation) { + view.positionViewAtEnd(); } } + } = - onMovementEnded: followConversation =3D atYEnd //we on= ly follow the conversation if moved to the end + onMovementEnded: followConversation =3D atYEnd //we only f= ollow the conversation if moved to the end = - onContentHeightChanged: { - if (followConversation && contentHeight > height) { - view.positionViewAtEnd() - } + onContentHeightChanged: { + if (followConversation && contentHeight > height) { + view.positionViewAtEnd() } + } = - onAtYBeginningChanged: { - if (atYBeginning) { - model.fetchMoreHistory(); - } + onAtYBeginningChanged: { + if (atYBeginning) { + model.fetchMoreHistory(); } + } = - Component.onCompleted: { - conversation.messages.visibleToUser =3D true; - } + Component.onCompleted: { + conversation.messages.visibleToUser =3D true; + } = - Component.onDestruction: { - conversation.messages.visibleToUser =3D false; - } - // } + Component.onDestruction: { + conversation.messages.visibleToUser =3D false; + } } = Kirigami.Label {