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


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

The following commit has been merged in the master branch:
commit 75beae4e852ea2d3d023c1e57acf44d0d6762707
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Mar 29 00:25:14 2012 +0100

    Working filtering, and working highlights
---
 declarative-plugin/qml-plugin.cpp                  |   1 +
 .../contents/ui/ContactList.qml                    |  45 ++++---
 .../contents/ui/ListContactDelegate.qml            | 131 +++++++++++----------
 3 files changed, 99 insertions(+), 78 deletions(-)

diff --git a/declarative-plugin/qml-plugin.cpp b/declarative-plugin/qml-plugin.cpp
index b06778e..ffc0c01 100644
--- a/declarative-plugin/qml-plugin.cpp
+++ b/declarative-plugin/qml-plugin.cpp
@@ -28,6 +28,7 @@ void QmlPlugin::registerTypes(const char *uri)
     // this can be used in QML because it spits out Conversations which
     // can be given to ChatWidget.qml
     qmlRegisterType<ContactList> (uri, 0, 1, "ContactList");
+    qmlRegisterUncreatableType<AccountsFilterModel> (uri, 0, 1, "AccountsFilterModel", "Filter cannot be created. Access through ContactList.filter");
 }
 
 Q_EXPORT_PLUGIN2(contactlist, QmlPlugin);
diff --git a/org.kde.ktp.contactlist/contents/ui/ContactList.qml b/org.kde.ktp.contactlist/contents/ui/ContactList.qml
index c5c2ecf..efadd7c 100644
--- a/org.kde.ktp.contactlist/contents/ui/ContactList.qml
+++ b/org.kde.ktp.contactlist/contents/ui/ContactList.qml
@@ -21,17 +21,7 @@ import Qt 4.7
 
 import org.kde.telepathy.contactlist 0.1 as KtpContactList
 import org.kde.plasma.components 0.1 as PlasmaComponents
-
-
-
-/// TODO
-// - connect buttons in toolbar to switch view
-// - (after above) animation from list to grid
-// - add bar @ the bottom for gridview (hidden in list view)
-// - get contact list to load nepomuk:/bla/foo/bar images as contact avatars
-// - add side panel with common contact actions
-// - highlight contacts on click
-// - Use properties properly and get rid of all the stupid onSomethingChagned methods.
+import org.kde.plasma.core 0.1 as PlasmaCore
 
 
 Item {
@@ -39,8 +29,23 @@ Item {
     anchors.fill: parent;    
     
     KtpContactList.ContactList {
-        id: contactList
-        
+        id: contactList   
+    }
+    
+    Component {
+        id: highlightBar
+        PlasmaCore.FrameSvgItem {
+                imagePath: "widgets/viewitem"
+                prefix: "hover"
+                width: contactsList.width
+                opacity: 0
+                Behavior on opacity {
+                    NumberAnimation {
+                        duration: 250
+                        easing.type: Easing.OutQuad
+                    }
+                }
+            }
     }
     
     ListView {
@@ -51,6 +56,7 @@ Item {
             topMargin: 5;
             left: parent.left;
             right: viewScrollBar.left;
+            rightMargin: 1
             bottom: parent.bottom;
         }
 
@@ -59,6 +65,15 @@ Item {
         boundsBehavior: Flickable.StopAtBounds
 
         delegate: ListContactDelegate {}
+        highlight: highlightBar
+        highlightMoveDuration: 250
+        highlightMoveSpeed: 1
+        highlightFollowsCurrentItem: true
+        
+        focus: true
+        
+        
+
     }
     
     PlasmaComponents.ScrollBar {
@@ -76,8 +91,8 @@ Item {
     }
     
     Component.onCompleted : {
-         contactList.filter.sortMode = SortByPresence;
-         contactList.filter.presenceTypeFilterFlags = HideAllOffline;
+         contactList.filter.sortMode = KtpContactList.AccountsFilterModel.SortByPresence;
+         contactList.filter.presenceTypeFilterFlags = KtpContactList.AccountsFilterModel.HideAllOffline
     }
 
 }
diff --git a/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml b/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
index b4b978a..544f4f2 100644
--- a/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
+++ b/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
@@ -22,78 +22,83 @@ 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
 
-PlasmaComponents.ListItem {
+Item {
     id: delegate;
     enabled: true
     
-    height: 30;
-//     width: parent.width;
-
-    PlasmaWidgets.IconWidget {
-        id: avatar;
-        width: 22;
-        height: parent.height;
-        icon: QIcon("im-user");
-
-        anchors {
-            left: parent.left;
-            leftMargin: 2;
-            verticalCenter: parent.verticalCenter;
-        }
+    height: 36;
+    width: parent.width
+    
+    PlasmaCore.FrameSvgItem {
+        id: padding
+        imagePath: "widgets/viewitem"
+        prefix: "hover"
+        opacity: 0
+        anchors.fill: parent
     }
+    
+    Item {
+        anchors.fill: parent
+        anchors.topMargin: padding.margins.top
+        anchors.bottomMargin: padding.margins.bottom
+        anchors.leftMargin: padding.margins.left
+        anchors.rightMargin: padding.margins.right
+        
 
-    PlasmaComponents.Label {
-        id: nickLabel;
-        text: aliasName;
-        font.bold: true
-        elide: Text.ElideRight
-
-        anchors {
-            left: avatar.right;
-            right: presenceIcon.left
-            leftMargin: 4;
-            verticalCenter: parent.verticalCenter;
+        PlasmaWidgets.IconWidget {
+            id: avatarLabel;
+            width: 30;
+            height: parent.height;
+            
+            icon : QIcon(avatar ? avatar : "im-user")
+            anchors {
+                left: parent.left;
+                verticalCenter: parent.verticalCenter;
+            }       
         }
-    }
 
-//     PlasmaComponents.Label {
-//         id: presenceMessageLabel;
-//         text: presenceMessage;
-//         elide: Text.ElideRight;
-//         font.italic: true;
-// 
-//         anchors {
-//             left: nickLabel.right;
-//             leftMargin: 4;
-//             right: presenceIcon.left;
-//             verticalCenter: parent.verticalCenter;
-//         }
-//     }
-    
-    PlasmaWidgets.IconWidget {
-            id: presenceIcon
-            width: 22
-            height: parent.height
-            icon: QIcon("user-online")
+        PlasmaComponents.Label {
+            id: nickLabel;
+            text: aliasName;
+            font.bold: true
+            elide: Text.ElideRight
+
             anchors {
-                right:parent.right
-                leftMargin: 4
-                verticalCenter: parent.verticalCenter
+                left: avatarLabel.right;
+                right: presenceLabel.left
+                leftMargin: 4;
+                verticalCenter: parent.verticalCenter;
             }
-    }
-
+        }
     
-//     Rectangle {
-//         color: "transparent";
-//         border.color: "red";
-//         anchors.fill: parent;
-//     }
+        PlasmaWidgets.IconWidget {
+                id: presenceLabel
+                width: 22
+                height: parent.height
+                icon: presenceIcon
+                anchors {
+                    right:parent.right
+                    leftMargin: 4
+                    verticalCenter: parent.verticalCenter
+                }
+        }
+    }
+      
+    MouseArea {
+        anchors.fill: parent
+        
+        hoverEnabled: true
 
-  
-//     MouseArea {
-//         anchors.fill: parent
-//         onDoubleClicked: {
-//             contactList.startChat(item);
-//         }
-//     }
+        onDoubleClicked: {
+            contactList.startChat(item);
+        }
+        
+        onEntered: {
+            contactsList.currentIndex = index;
+            contactsList.highlightItem.opacity = 1;
+        }
+        onExited: {
+            contactsList.highlightItem.opacity = 0;
+        }
+    }
 }

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list