[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:07 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=94a8025

The following commit has been merged in the master branch:
commit 94a8025efa7900ea299e39d36f7fd0f96183ab7e
Author: Aleix Pol <aleixpol at kde.org>
Date:   Tue Apr 17 16:36:22 2012 +0200

    Improve and simplify Chat Delegates
    
    Changes the TextDelegate to just display the text messages, puts the name on the section delegate
    For outgoing chats, leaves the same text color and puts a background color to differenciate
    
    REVIEW: 104635
---
 chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml   |  8 +--
 .../contents/ui/OutgoingDelegate.qml               |  9 ++-
 chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml | 66 ++++++++++------------
 3 files changed, 40 insertions(+), 43 deletions(-)

diff --git a/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml b/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
index 41e16fd..30efb4d 100644
--- a/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
@@ -87,16 +87,14 @@ Item {
             leftMargin: 5
         }
         boundsBehavior: Flickable.StopAtBounds
+        section.property: "user"
+        section.delegate: PlasmaComponents.Label { text: section; font.bold: true; anchors.right: parent.right}
         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:
 //                             console.log("Type: MessagesModel::MessageTypeOutgoing");
                         source = "OutgoingDelegate.qml"
@@ -105,8 +103,8 @@ Item {
 //                             console.log("Type: MessagesModel::MessageTypeAction");
                         source = "ActionDelegate.qml";
                         break;
+                    case MessagesModel.MessageTypeIncoming:
                     default:
-//                             console.log("ERROR: UNKNOWN MESSAGE TYPE! Defaulting to fallback handler");
                         source = "TextDelegate.qml";
                 }
             }
diff --git a/chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml b/chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml
index 4dd8165..79bb681 100644
--- a/chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/OutgoingDelegate.qml
@@ -1,5 +1,10 @@
-import org.kde.plasma.core 0.1 as PlasmaCore
+import QtQuick 1.0
 
 TextDelegate {
-    textColor: theme.highlightColor
+    Rectangle {
+        color: theme.viewBackgroundColor
+        anchors.fill: parent
+        z: parent.z-1
+        opacity: 0.7
+    }
 }
\ No newline at end of file
diff --git a/chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml b/chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml
index b205d77..36b80bc 100644
--- a/chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml
@@ -1,46 +1,40 @@
-import Qt 4.7
+import QtQuick 1.0
 import org.kde.plasma.components 0.1 as PlasmaComponents
-import org.kde.plasma.core 0.1 as PlasmaCore
-import org.kde.telepathy.chat 0.1
 
-Item {
-    property color textColor: "black"
+PlasmaComponents.Label {
+    id: body
+    wrapMode: Text.Wrap
+    width: view.width
 
-    PlasmaComponents.Label {
-        id: header
-
-        width: view.width
-        wrapMode: Text.Wrap
-
-        color: textColor
-        text: "<b>[" + Qt.formatTime(model.time) + "] " + model.user + " :</b>"
+    text: model.text
+    textFormat: Text.RichText
+    height: paintedHeight
 
-        verticalAlignment: Text.AlignBottom
-
-        visible: !model.continuing
-        Component.onCompleted: {
-            if(model.continuing) {
-                height = 0;
-            }
-        }
+    onLinkActivated: {
+        console.log("opening link: " + link);
+        plasmoid.openUrl(link);
     }
-    PlasmaComponents.Label {
-        id: body
 
-        anchors.top: header.bottom
-        width: view.width
-        wrapMode: Text.Wrap
-
-        color: textColor
-        text: model.text
-        textFormat: Text.RichText
-        height: paintedHeight
-
-        onLinkActivated: {
-            console.log("opening link: " + link);
-            plasmoid.openUrl(link);
+    //Hover to display the time when hovering a message
+    PlasmaComponents.Label {
+        text: Qt.formatTime(model.time)
+        anchors {
+            top: parent.top
+            right: parent.right
         }
+        Rectangle {
+            color: theme.backgroundColor
+            anchors.fill: parent
+            z: parent.z-1
+            opacity: 0.8
+            radius: 5
+        }
+        visible: mouseArea.containsMouse
     }
 
-    height: header.height + body.height
+    MouseArea {
+        id: mouseArea
+        anchors.fill: parent
+        hoverEnabled: true
+    }
 }
\ No newline at end of file

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list