[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:28 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=d1b7aac
The following commit has been merged in the master branch:
commit d1b7aac4f4c0f688f3866de3650a047f60c75b74
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date: Sat Aug 20 03:09:29 2011 +0200
ADD action buttons for contact
when plasmoid is clicked, a dropdown menu is shown.
---
src/declarative/contents/ui/Avatar.qml | 7 ++-
src/declarative/contents/ui/Contact.qml | 19 +++++-
.../contents/ui/{main.qml => DropDownMenu.qml} | 68 +++++++++++++++++++---
src/declarative/contents/ui/main.qml | 5 ++
4 files changed, 87 insertions(+), 12 deletions(-)
diff --git a/src/declarative/contents/ui/Avatar.qml b/src/declarative/contents/ui/Avatar.qml
index a6713ed..235af67 100644
--- a/src/declarative/contents/ui/Avatar.qml
+++ b/src/declarative/contents/ui/Avatar.qml
@@ -21,10 +21,14 @@ import Qt 4.7
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
Item {
+ id: container;
+
// eliminate once finished. This is only a test image
property string avatarPath: "";
property string avatarPresenceStatus;
+ signal clicked();
+
anchors.fill: parent;
Component.onCompleted: {
@@ -38,7 +42,8 @@ Item {
anchors.margins: 10;
onClicked: {
- showMenu();
+ // toggleMenu
+ container.clicked();
}
Component.onCompleted: {
diff --git a/src/declarative/contents/ui/Contact.qml b/src/declarative/contents/ui/Contact.qml
index a2badb5..ea2bfda 100644
--- a/src/declarative/contents/ui/Contact.qml
+++ b/src/declarative/contents/ui/Contact.qml
@@ -27,7 +27,7 @@ Item {
anchors.fill: parent;
- Avatar{
+ Avatar {
id: avatar;
avatarPresenceStatus: wrapper.status;
@@ -36,11 +36,26 @@ Item {
left: parent.left;
right: parent.right;
}
+
+ onClicked: {
+ dropDownMenu.toggleMenu();
+ }
+ }
+
+ DropDownMenu {
+ id: dropDownMenu;
+ width: wrapper.width;
+
+ anchors {
+ top: avatar.bottom;
+ left: avatar.left;
+ right: avatar.right;
+ }
}
function update()
{
- if ( wrapper.status != TelepathyContact.presenceStatus) {
+ if (wrapper.status != TelepathyContact.presenceStatus) {
wrapper.status = TelepathyContact.presenceStatus;
avatar.setAvatarPresenceStatus(wrapper.status);
}
diff --git a/src/declarative/contents/ui/main.qml b/src/declarative/contents/ui/DropDownMenu.qml
similarity index 52%
copy from src/declarative/contents/ui/main.qml
copy to src/declarative/contents/ui/DropDownMenu.qml
index 943e550..48f0b5f 100644
--- a/src/declarative/contents/ui/main.qml
+++ b/src/declarative/contents/ui/DropDownMenu.qml
@@ -18,21 +18,71 @@
***************************************************************************/
import Qt 4.7
+import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
Item {
- id: mainWidget;
+ id: container;
+ state: "hidden";
- // default contact size (also ni metadata file) just to be sure
- width: 128;
- height: 128;
-
- Contact {
- id: contact;
+ Row {
+ spacing: 4;
anchors.centerIn: parent;
+
+ PlasmaWidgets.IconWidget {
+ id: callButton;
+ icon: QIcon("call-start");
+ width: 22;
+ height: 22
+ }
+
+ PlasmaWidgets.IconWidget {
+ id: mailButton;
+ icon: QIcon("mail-flag");
+ width: 22;
+ height: 22
+ }
+
+ PlasmaWidgets.IconWidget {
+ id: chatButton;
+ icon: QIcon("document-edit");
+ width: 22;
+ height: 22;
+ }
}
- function updateContact()
+ states: [
+ State {
+ name: "visible";
+ PropertyChanges {
+ target: container;
+ height: 30;
+ opacity: 1;
+ }
+ },
+ State {
+ name: "hidden";
+ PropertyChanges {
+ target: container;
+ height: 0;
+ opacity: 0;
+ }
+ }
+ ]
+
+ transitions:
+ Transition {
+ NumberAnimation {
+ properties: "height,opacity";
+ easing.type: Easing.Linear;
+ }
+ }
+
+ function toggleMenu()
{
- contact.update();
+ if (state == "hidden") {
+ state = "visible";
+ } else {
+ state = "hidden";
+ }
}
}
diff --git a/src/declarative/contents/ui/main.qml b/src/declarative/contents/ui/main.qml
index 943e550..42fa0fd 100644
--- a/src/declarative/contents/ui/main.qml
+++ b/src/declarative/contents/ui/main.qml
@@ -35,4 +35,9 @@ Item {
{
contact.update();
}
+
+ function toggleDropDownMenu()
+ {
+ contact.toggleMenu();
+ }
}
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list