[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:12:43 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=aa5cd19
The following commit has been merged in the master branch:
commit aa5cd19add5b4bcc1a529f1258e713a9ab82597a
Author: Lasath Fernando <kde at lasath.org>
Date: Mon Dec 5 19:34:54 2011 +1100
UI improvements
---
chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml | 202 +++++++++++++--------
.../contents/ui/ConversationDelegate.qml | 96 ++++++++++
chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml | 13 +-
chat/org.kde.ktp-chat/metadata.desktop | 2 +-
4 files changed, 238 insertions(+), 75 deletions(-)
diff --git a/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml b/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
index d966f32..af1dc4e 100644
--- a/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/ChatWidget.qml
@@ -2,98 +2,158 @@ import Qt 4.7
import org.kde.telepathy.declarativeplugins 0.1
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
-/*PlasmaCore.Dialog {
- id:main
+Item {
+ property Conversation conv
- function derp() {
- console.log("deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerp!");
- return true;
- }
+ signal closeRequested
+ signal conversationEndRequested
+ Item {
+ id: titleArea
+ anchors {
+ margins: 5
+ top: parent.top
+ left: parent.left; right: parent.right
+ }
+ height: 24
- mainItem: */
-Item {
- property Conversation conv
+ PlasmaComponents.ToolButton {
+ id: contactButton
+
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: closeButton.left
+ bottom: parent.bottom
+ }
- PlasmaWidgets.IconWidget {
- id: title
text: conv.target.nick
- icon: conv.target.avatar
- anchors.top: parent.top
- anchors.left: parent.left; anchors.right: parent.right
- // anchors.bottom: chatArea.top
- height: 12
- orientation: Qt.Horizontal
+ iconSource: conv.target.presenceIconSource
+
+ onClicked: closeRequested()
+ }
+
+ PlasmaComponents.ToolButton {
+ id: closeButton
+
+ anchors {
+ top: parent.top
+ right: parent.right
+ bottom: parent.bottom
+ }
+
+ iconSource: "dialog-close"
+
+ onClicked: conversationEndRequested()
+ }
+ }
+
+ PlasmaWidgets.Separator {
+ id: space
+ anchors {
+ top: titleArea.bottom
+ left: parent.left
+ right: parent.right
}
+ orientation: Qt.Horizontal
+ }
+
+
+ Item {
+ id:chatArea
- Item {
- id:chatArea
+ anchors.top: space.bottom
+ anchors.left: parent.left; anchors.right: parent.right
+ anchors.bottom: input.top
+ anchors.margins: 5
- // anchors.top: parent.top
- anchors.top: title.bottom
- anchors.left: parent.left; anchors.right: parent.right
- anchors.bottom: input.top
- anchors.margins: 5
+// PlasmaComponents.Highlight { anchors.fill: chatArea }
- Rectangle {
- anchors.fill: chatArea
+ ListView {
+ id: view
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ left: parent.left
+ right: viewScrollBar.left
}
+ boundsBehavior: Flickable.StopAtBounds
+ clip: true
- ListView {
- id: view
+ delegate: TextDelegate {}
+ model: conv.model
+ }
- anchors.fill: parent
- clip: true
+ PlasmaComponents.ScrollBar {
+ id: viewScrollBar
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ right: parent.right
+ }
- delegate: TextDelegate {}
- model: conv.model
- ListView.onAdd: {
- derp();
+ flickableItem: view
+ width: 16
+ opacity: 1
+ orientation: Qt.Vertical
+ }
+
+
+ //used states here to make the scroll bar (dis)appear
+ states: [
+ State {
+ name: "auto-scrolling"
+ when: view.atYEnd
+ PropertyChanges {
+ target: view.model
+ restoreEntryValues: true
+ onRowsInserted: {
+ view.positionViewAtEnd();
+ }
+ }
+ PropertyChanges {
+ target: viewScrollBar
+ restoreEntryValues: true
+ width: 0
+ opacity: 0
}
}
+ ]
- //used states here because it'll make a scrollbar (dis)appear later on
- states: [
- State {
- name: "static"
- },
- State {
- name: "auto-scrolling"
- PropertyChanges {
- target: view.model
- restoreEntryValues: true
- onRowsInserted: {
- view.positionViewAtEnd();
- }
- }
+ transitions: [
+ Transition {
+ from: "*"
+ to: "auto-scrolling"
+
+ PropertyAnimation {
+ properties: "width,opacity"
+ duration: 250
}
- ]
+ },
+ Transition {
+ from: "auto-scrolling"
+ to: "*"
+
+ PropertyAnimation {
+ properties: "width,opacity"
+ duration: 250
+ }
+ }
+ ]
+ }
- }
+ PlasmaWidgets.LineEdit {
+ id: input
- PlasmaWidgets.LineEdit {
- id: input
- // anchors.top: view.bottom
- anchors.left: parent.left; anchors.right: parent.right
- anchors.bottom: parent.bottom
+ anchors.left: parent.left; anchors.right: parent.right
+ anchors.bottom: parent.bottom
- onReturnPressed: {
- view.model.sendNewMessage(text);
- text = "";
- }
+ onReturnPressed: {
+ view.model.sendNewMessage(text);
+ text = "";
}
}
-
-// ConversationWatcher {
-// id:watcher
-// onNewConversation: {
-// console.log("New Convo!");
-// conv = con;
-// // conv.model = con.model;
-// // view.model.rowsInserted.connect(view.positionViewAtEnd);
-// chatArea.state = "auto-scrolling";
-// }
-// }
-// }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/chat/org.kde.ktp-chat/contents/ui/ConversationDelegate.qml b/chat/org.kde.ktp-chat/contents/ui/ConversationDelegate.qml
new file mode 100644
index 0000000..6ddffeb
--- /dev/null
+++ b/chat/org.kde.ktp-chat/contents/ui/ConversationDelegate.qml
@@ -0,0 +1,96 @@
+import Qt 4.7
+import org.kde.telepathy.declarativeplugins 0.1
+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
+
+Item {
+ PlasmaCore.FrameSvgItem {
+ id: canvas
+
+ prefix: "normal"
+ imagePath: "widgets/tasks"
+ opacity: 1
+ anchors.fill: parent
+// anchors.margins: 5
+ }
+// height: icon.height + 10
+ width: icon.width + 10
+
+ PlasmaCore.Dialog {
+ id: dialog
+ windowFlags: Qt.Dialog
+ mainItem: ChatWidget {
+ width: 250
+ height: 350
+ conv: model.conversation
+
+ onCloseRequested: mouse.popupApplet()
+ }
+ }
+
+ //ise listitem?
+ PlasmaWidgets.IconWidget {
+ id: icon
+// text: model.conversation.target.nick
+ icon: model.conversation.target.presenceIcon
+// anchors {
+// top: parent.top
+// left: parent.left
+// }
+ anchors.fill: parent
+ anchors.margins: 5
+
+// size: "32x32"
+ size: {
+ console.log("height = " + parent.height);
+ console.log("width = " + parent.width);
+ return Qt.size(parent.height, parent.height);
+ }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+
+ hoverEnabled: true
+
+ //move le onClicked into main
+ onClicked: popupApplet()
+ function popupApplet() {
+ if(dialog.visible == false) {
+ var point = dialog.popupPosition(icon, Qt.AlignBottom);
+ console.log("Showing dialog at (" + point.x + "," + point.y + ")");
+
+ dialog.x = point.x;
+ dialog.y = point.y;
+
+ dialog.visible = true;
+ } else {
+ console.log("height = " + dialog.height);
+ console.log("width = " + dialog.width);
+ dialog.visible = false;
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "focus"
+ //use property instead
+ when: dialog.visible
+ PropertyChanges {
+ target: canvas
+ prefix: "focus"
+ }
+ },
+ State {
+ name: "hover"
+ when: mouse.containsMouse
+ PropertyChanges {
+ target: canvas
+ prefix: "hover"
+ }
+ }
+ ]
+}
\ 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 845eb59..2b64707 100644
--- a/chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml
+++ b/chat/org.kde.ktp-chat/contents/ui/TextDelegate.qml
@@ -1,20 +1,27 @@
import Qt 4.7
+import org.kde.plasma.components 0.1 as PlasmaComponents
+import org.kde.plasma.core 0.1 as PlasmaCore
Item {
- Text {
+ property color textColor: theme.textColor
+
+ PlasmaComponents.Label {
id: header
+
width: view.width
wrapMode: Text.Wrap
+ color: textColor
text: "[" + Qt.formatTime(model.time) + "] " + model.user + " :"
}
- Text {
+ PlasmaComponents.Label {
id: body
anchors.top: header.bottom
width: view.width
-
wrapMode: Text.Wrap
+
+ color: textColor
text: model.text
}
diff --git a/chat/org.kde.ktp-chat/metadata.desktop b/chat/org.kde.ktp-chat/metadata.desktop
index 6b0c002..75d4f67 100644
--- a/chat/org.kde.ktp-chat/metadata.desktop
+++ b/chat/org.kde.ktp-chat/metadata.desktop
@@ -5,7 +5,7 @@ Icon=kde-telepathy
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
-X-Plasma-DefaultSize=300,200
+X-Plasma-DefaultSize=300,48
# X-Plasma-RequiredExtensions=LaunchApp
X-KDE-PluginInfo-Author=Frederik Gladhorn
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list