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


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

The following commit has been merged in the master branch:
commit ba3e695b13a105eb2407f8f45e4e7283fb58fc38
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Thu Jul 28 14:31:20 2011 +0200

    ADD gridview to plasmoid
---
 ...dContactDelegate.qml => ContactDisplayName.qml} | 27 ++++------
 package/contents/ui/ContactList.qml                | 60 +++++++++++++++++++++-
 package/contents/ui/GridContactDelegate.qml        | 18 +++++++
 package/contents/ui/main.qml                       |  1 +
 4 files changed, 89 insertions(+), 17 deletions(-)

diff --git a/package/contents/ui/GridContactDelegate.qml b/package/contents/ui/ContactDisplayName.qml
similarity index 76%
copy from package/contents/ui/GridContactDelegate.qml
copy to package/contents/ui/ContactDisplayName.qml
index 7d33925..854e5d6 100644
--- a/package/contents/ui/GridContactDelegate.qml
+++ b/package/contents/ui/ContactDisplayName.qml
@@ -17,26 +17,21 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
+/*
+  This component is used ONLY by the contactlist in GRID view mode. It
+  displays the contact display name when a contact is hovered over.
+*/
+
 import Qt 4.7
+//import org.kde.plasma.core 0.1 as PlasmaCore
 import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
 
-/// TODO
-// - add status border (colour like on the presence plasmoid)
-// - bottom status bar with displayName on hover
-// - rounded borders for image
-
 Item {
-    id: gridDelegate;
-
-    property string delegateDisplayName;
-    property string delegateAvatar;
-
-    width: 40;
-    height: 40;
+    property string nickToShow;
 
-    PlasmaWidgets.IconWidget {
-        id: contactIcon;
-        icon: QIcon("im-user");         // temp icon until it's sorted out
-        anchors.centerIn: gridDelegate;
+    PlasmaWidgets.Label {
+        id: idLabel;
+        text: nickToShow;
+        anchors.fill: parent;
     }
 }
diff --git a/package/contents/ui/ContactList.qml b/package/contents/ui/ContactList.qml
index f4b6ad1..b9847fe 100644
--- a/package/contents/ui/ContactList.qml
+++ b/package/contents/ui/ContactList.qml
@@ -18,6 +18,7 @@
  ***************************************************************************/
 
 import Qt 4.7
+import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
 
 // import nepomuk models
 import org.kde.telepathy.declarativeplugins 0.1 as TelepathyDeclarative
@@ -31,11 +32,14 @@ import org.kde.telepathy.declarativeplugins 0.1 as TelepathyDeclarative
 // - highlight contacts on click
 
 Item {
+    id: contactListContainer;
     anchors.fill: parent;
 
+    // LISTVIEW
     ListView {
         id: contactsList;
         anchors.fill: parent;
+        clip: true;
         model: TelepathyDeclarative.ContactListModel{}
 
         delegate:
@@ -44,9 +48,19 @@ Item {
             }
     }
 
+    // GRIDVIEW
     GridView {
         id: contactsGrid;
-        anchors.fill: parent;
+        boundsBehavior: Flickable.StopAtBounds;
+        clip: true;
+        height: parent.height - 30;
+        anchors {
+            top: parent.top;
+            left: parent.left;
+            right: parent.right;
+            margins: 5;
+        }
+
         model: TelepathyDeclarative.ContactListModel{}
 
         cellWidth: 48;
@@ -54,11 +68,39 @@ Item {
 
         delegate:
             GridContactDelegate {
+                id: gridDelegate;
                 delegateDisplayName: displayName;
                 delegateAvatar: avatar;
+
+                onSetGridContactDisplayName: {
+                    console.log("SETTING NAME TO: " + gridContactDisplayName)
+                    contactDisplay.nickToShow = gridContactDisplayName;
+                }
             }
     }
 
+    PlasmaWidgets.Separator {
+        id: separator;
+        anchors {
+            top: contactsGrid.bottom;
+            left: parent.left;
+            right:parent.right;
+            bottom: contactDisplay.top;
+        }
+    }
+
+    ContactDisplayName {
+        id: contactDisplay;
+
+        anchors {
+            top: contactsGrid.bottom;
+            left: contactListContainer.left;
+            right: contactListContainer.right;
+            bottom: contactListContainer.bottom;
+            margins: 5;
+        }
+    }
+
     states: [
         State {
             name: "listView";
@@ -70,6 +112,14 @@ Item {
                 target: contactsGrid;
                 opacity: 0;
             }
+            PropertyChanges {
+                target: contactDisplay;
+                opacity: 0;
+            }
+            PropertyChanges {
+                target: separator;
+                opacity: 0
+            }
         },
         State {
             name: "gridView";
@@ -81,6 +131,14 @@ Item {
                 target: contactsGrid;
                 opacity: 1;
             }
+            PropertyChanges {
+                target: contactDisplay;
+                opacity: 1;
+            }
+            PropertyChanges {
+                target: separator;
+                opacity: 1;
+            }
         }
     ]
 }
diff --git a/package/contents/ui/GridContactDelegate.qml b/package/contents/ui/GridContactDelegate.qml
index 7d33925..cb5c2e0 100644
--- a/package/contents/ui/GridContactDelegate.qml
+++ b/package/contents/ui/GridContactDelegate.qml
@@ -31,6 +31,9 @@ Item {
     property string delegateDisplayName;
     property string delegateAvatar;
 
+    // emitted when mouse hovers over contact
+    signal setGridContactDisplayName(variant gridContactDisplayName);
+
     width: 40;
     height: 40;
 
@@ -39,4 +42,19 @@ Item {
         icon: QIcon("im-user");         // temp icon until it's sorted out
         anchors.centerIn: gridDelegate;
     }
+
+    MouseArea {
+        anchors.fill: parent;
+        hoverEnabled: true;
+
+        // set contact name in view
+        onEntered: {
+            gridDelegate.setGridContactDisplayName(delegateDisplayName);
+        }
+
+        // unset contact name in view
+        onExited: {
+            gridDelegate.setGridContactDisplayName("");
+        }
+    }
 }
diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml
index 4be3e01..c882138 100644
--- a/package/contents/ui/main.qml
+++ b/package/contents/ui/main.qml
@@ -27,6 +27,7 @@ Item {
 
     // TODO make plasmoid busy when loading contacts on startup to avoid the user
     // complaining about sluggish plasmoid. The "slowness" is caused by nepomuk storing 1000000000000 contacts
+    // need to make model faster (talk to david)
 
     // contact listview
     ContactList {

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list