[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:14:02 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=040ba89
The following commit has been merged in the master branch:
commit 040ba89b12f72e4fa78486c0dcd2114d8d0fb46b
Author: Aleix Pol <aleixpol at kde.org>
Date: Thu Apr 12 19:19:18 2012 +0200
Tries to address a few problems the chat view has and simplifies the code (a tiny bit).
just reduce opacity when the view is at the end. Having a scroll flickering doesn't feel good and helps reduce the stress the scrollbar adds in such a small UI when it's not needed. reduce the impact on the bug that appears when the chat is growing too fast
REVIEW: 104554
---
chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml | 146 ++++++++---------------
1 file changed, 49 insertions(+), 97 deletions(-)
diff --git a/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml b/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
index 740cb34..41e16fd 100644
--- a/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
@@ -1,6 +1,5 @@
import QtQuick 1.1
import org.kde.telepathy.chat 0.1
-import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
import org.kde.plasma.components 0.1 as PlasmaComponents
@@ -14,7 +13,8 @@ Item {
anchors {
margins: 5
top: parent.top
- left: parent.left; right: parent.right
+ left: parent.left
+ right: parent.right
}
height: 24
@@ -76,126 +76,78 @@ Item {
orientation: Qt.Horizontal
}
-
- Item {
- id:chatArea
-
+ ListView {
+ id: view
anchors {
top: space.bottom
left: parent.left
right: parent.right
bottom: input.top
-
+ rightMargin: viewScrollBar.width+5
leftMargin: 5
- rightMargin: chatArea.anchors.leftMargin
}
-
-// contemplating if this makes it look better or worse
-// PlasmaComponents.Highlight { anchors.fill: chatArea }
-
- ListView {
- id: view
- anchors {
- top: parent.top
- bottom: parent.bottom
- left: parent.left
- right: viewScrollBar.left
- }
- boundsBehavior: Flickable.StopAtBounds
- clip: true
-
- delegate: Loader {
- Component.onCompleted: {
- console.log(model.type);
- switch(model.type) {
- case MessagesModel.MessageTypeIncoming:
+ boundsBehavior: Flickable.StopAtBounds
+ clip: true
+
+ delegate: Loader {
+ Component.onCompleted: {
+ console.log(model.type);
+ switch(model.type) {
+ case MessagesModel.MessageTypeIncoming:
// console.log("Type: MessagesModel::MessageTypeIncoming");
- source = "IncomingDelegate.qml";
- break;
- case MessagesModel.MessageTypeOutgoing:
+ source = "IncomingDelegate.qml";
+ break;
+ case MessagesModel.MessageTypeOutgoing:
// console.log("Type: MessagesModel::MessageTypeOutgoing");
- source = "OutgoingDelegate.qml"
- break;
- case MessagesModel.MessageTypeAction:
+ source = "OutgoingDelegate.qml"
+ break;
+ case MessagesModel.MessageTypeAction:
// console.log("Type: MessagesModel::MessageTypeAction");
- source = "ActionDelegate.qml";
- break;
- default:
+ source = "ActionDelegate.qml";
+ break;
+ default:
// console.log("ERROR: UNKNOWN MESSAGE TYPE! Defaulting to fallback handler");
- source = "TextDelegate.qml";
- }
+ source = "TextDelegate.qml";
}
}
-
- model: conv.messages
- }
-
- PlasmaComponents.ScrollBar {
- id: viewScrollBar
- anchors {
- top: parent.top
- bottom: parent.bottom
- right: parent.right
- }
-
- flickableItem: view
- interactive: true
- width: 16
- opacity: 1
- orientation: Qt.Vertical
}
+ model: conv.messages
- //used states here to make the scroll bar (dis)appear
- states: [
- State {
- name: "auto-scrolling"
- when: view.atYEnd
- PropertyChanges {
- target: view.model
- restoreEntryValues: true
- onRowsInserted: {
- view.positionViewAtEnd();
- }
- }
- PropertyChanges {
- target: viewScrollBar
- restoreEntryValues: true
- width: 0
- opacity: 0
- }
+ onCountChanged: {
+ if((view.contentHeight-view.contentY)<(1.2*view.height)) {
+ view.positionViewAtEnd()
}
- ]
+ }
+ }
- transitions: [
- Transition {
- from: "*"
- to: "auto-scrolling"
+ PlasmaComponents.ScrollBar {
+ id: viewScrollBar
+ anchors {
+ top: view.top
+ bottom: view.bottom
+ right: parent.right
+ }
- PropertyAnimation {
- properties: "width,opacity"
- duration: 250
- }
- },
- Transition {
- from: "auto-scrolling"
- to: "*"
-
- PropertyAnimation {
- properties: "width,opacity"
- duration: 250
- }
- }
- ]
+ flickableItem: view
+ width: 16
+ orientation: Qt.Vertical
+ opacity: view.atYEnd ? 0.3 : 1
+
+ Behavior on width { NumberAnimation { duration: 250 } }
+ Behavior on opacity { NumberAnimation { duration: 250 } }
}
PlasmaWidgets.LineEdit {
id: input
- //FIXME: replace with Plasma Component and focus
+ //FIXME: replace with PlasmaComponents.LineEdit and focus, not before KDE 4.9 because it lacks onAccepted
// focus: true
- anchors.left: parent.left; anchors.right: parent.right
- anchors.bottom: parent.bottom
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
onReturnPressed: {
view.model.sendNewMessage(text);
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list