[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:32 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=9fc4dec
The following commit has been merged in the master branch:
commit 9fc4dec9d0c8a86a97633141f065a7006c1f0be4
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date: Fri Aug 26 12:20:13 2011 +0200
ADD delegate for gridview and made a descriptive status bar
the status bar shows contact name and personal message when a contact is hovered
over
---
src/declarative/contents/ui/ContactDisplayName.qml | 36 +++++++++--
src/declarative/contents/ui/ContactList.qml | 8 ++-
.../contents/ui/GridContactDelegate.qml | 70 ++++++++++++++++++++--
src/declarative/contents/ui/main.qml | 3 +-
src/telepathyContactList.cpp | 1 +
5 files changed, 106 insertions(+), 12 deletions(-)
diff --git a/src/declarative/contents/ui/ContactDisplayName.qml b/src/declarative/contents/ui/ContactDisplayName.qml
index 854e5d6..9148e08 100644
--- a/src/declarative/contents/ui/ContactDisplayName.qml
+++ b/src/declarative/contents/ui/ContactDisplayName.qml
@@ -19,19 +19,45 @@
/*
This component is used ONLY by the contactlist in GRID view mode. It
- displays the contact display name when a contact is hovered over.
+ displays basic contact info when a contact is hovered over.
*/
import Qt 4.7
-//import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
Item {
- property string nickToShow;
+ property string contactNickToShow;
+ property string contactPresenceMessage;
+
+ // get color from current plasma theme
+ property QtObject theme: PlasmaCore.Theme {}
PlasmaWidgets.Label {
id: idLabel;
- text: nickToShow;
- anchors.fill: parent;
+ text: contactNickToShow;
+ font.bold: true;
+ width: parent.width/2;
+
+ anchors {
+ left: parent.left;
+ verticalCenter: parent.verticalCenter;
+ }
+ }
+
+ Text {
+ id: presenceMessage;
+ text: contactPresenceMessage;
+ color: theme.textColor;
+
+ font.italic: true;
+ elide: Text.ElideRight;
+
+ anchors {
+ left: idLabel.right;
+ leftMargin: 2;
+ right: parent.right;
+ verticalCenter: parent.verticalCenter;
+ }
}
}
diff --git a/src/declarative/contents/ui/ContactList.qml b/src/declarative/contents/ui/ContactList.qml
index 1c10302..5a97011 100644
--- a/src/declarative/contents/ui/ContactList.qml
+++ b/src/declarative/contents/ui/ContactList.qml
@@ -108,10 +108,14 @@ Item {
id: gridDelegate;
delegateDisplayName: displayName;
delegateAvatar: avatar;
+// delegatePresenceIcon: presenceIcon;
+ delegatePresenceName: presenceName;
+ delegatePresenceMessage: presenceMessage;
onSetGridContactDisplayName: {
- console.log("SETTING NAME TO: " + gridContactDisplayName)
- contactDisplay.nickToShow = gridContactDisplayName;
+ console.log("SETTING NAME TO: " + gridContactDisplayName + " with presence msg: " + gridPresenceMessage);
+ contactDisplay.contactNickToShow = gridContactDisplayName;
+ contactDisplay.contactPresenceMessage = gridPresenceMessage;
}
}
}
diff --git a/src/declarative/contents/ui/GridContactDelegate.qml b/src/declarative/contents/ui/GridContactDelegate.qml
index cb5c2e0..a707923 100644
--- a/src/declarative/contents/ui/GridContactDelegate.qml
+++ b/src/declarative/contents/ui/GridContactDelegate.qml
@@ -30,9 +30,13 @@ Item {
property string delegateDisplayName;
property string delegateAvatar;
+// property QIcon delegatePresenceIcon;
+ property string delegatePresenceMessage;
+// property string delegatePresenceType;
+ property string delegatePresenceName;
// emitted when mouse hovers over contact
- signal setGridContactDisplayName(variant gridContactDisplayName);
+ signal setGridContactDisplayName(variant gridContactDisplayName, variant gridPresenceMessage);
width: 40;
height: 40;
@@ -40,7 +44,24 @@ Item {
PlasmaWidgets.IconWidget {
id: contactIcon;
icon: QIcon("im-user"); // temp icon until it's sorted out
- anchors.centerIn: gridDelegate;
+ anchors.fill: parent;
+ }
+
+ BorderImage {
+ id: avatarFrame;
+ width: parent.width;
+ height: parent.height;
+
+ border {
+ left: 2
+ right: 2
+ top: 2
+ bottom: 2
+ }
+
+ anchors {
+ centerIn: gridDelegate;
+ }
}
MouseArea {
@@ -49,12 +70,53 @@ Item {
// set contact name in view
onEntered: {
- gridDelegate.setGridContactDisplayName(delegateDisplayName);
+ gridDelegate.setGridContactDisplayName(delegateDisplayName, delegatePresenceMessage);
}
// unset contact name in view
onExited: {
- gridDelegate.setGridContactDisplayName("");
+ gridDelegate.setGridContactDisplayName("", "");
+ }
+ }
+
+ onDelegatePresenceNameChanged: {
+ console.log("CHANGING BORDER to_ : " + delegatePresenceName);
+ setAvatarPresenceStatus(delegatePresenceName);
+ }
+
+ function setAvatarPresenceStatus(presenceStatus)
+ {
+ switch (presenceStatus) {
+ case "available":
+ avatarFrame.source = "../frames/online.png";
+ if (!avatar.enabled) {
+ avatar.enabled = true;
+ }
+ break;
+ case "dnd":
+ avatarFrame.source = "../frames/busy.png";
+ if (!avatar.enabled) {
+ avatar.enabled = true;
+ }
+ break;
+ case "away":
+ avatarFrame.source = "../frames/away.png";
+ if (!avatar.enabled) {
+ avatar.enabled = true;
+ }
+ break;
+ case "offline":
+ avatarFrame.source = "../frames/offline.png";
+ if (avatar.enabled) {
+ avatar.enabled = false;
+ }
+ break;
+ default:
+ avatarFrame.source = "../frames/offline.png";
+ if (avatar.enabled) {
+ avatar.enabled = false;
+ }
+ break;
}
}
}
diff --git a/src/declarative/contents/ui/main.qml b/src/declarative/contents/ui/main.qml
index fdcbab8..7472a28 100644
--- a/src/declarative/contents/ui/main.qml
+++ b/src/declarative/contents/ui/main.qml
@@ -27,6 +27,7 @@ Item {
y:10;
// plasmoid starting size
+ /// TODO load this from KConfig and read from C++
width: 230;
height: 380;
@@ -38,7 +39,7 @@ Item {
ContactList {
id: contactList;
anchors.fill: parent;
- state: "listView"; // start with list view
+ state: "gridView";//"listView"; // start with list view
}
Rectangle {
diff --git a/src/telepathyContactList.cpp b/src/telepathyContactList.cpp
index 9f71388..cfb968b 100644
--- a/src/telepathyContactList.cpp
+++ b/src/telepathyContactList.cpp
@@ -37,6 +37,7 @@ TelepathyContactList::TelepathyContactList(QObject* parent, const QVariantList&
{
// set plasmoid size
setMinimumSize(250, 400);
+ setAspectRatioMode(Plasma::IgnoreAspectRatio);
}
TelepathyContactList::~TelepathyContactList()
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list