Implement the ChatLine element in C++
[quassel.git] / src / qmlui / qml / ChatView.qml
index 5781fc7..aa72fb4 100644 (file)
@@ -1,6 +1,8 @@
-import QtQuick 1.0
+import QtQuick 1.1
 // import Qt.components 1.0
 
+import eu.quassel.qmlui 1.0
+
 Rectangle {
   id: container
 
@@ -8,14 +10,40 @@ Rectangle {
     id: chatView
     anchors.fill: parent
     model: msgModel
+
     delegate: Component {
-      ChatLine { }
+      ChatLine {
+        chatLineData: chatLineDataRole
+      }
     }
 
+    //interactive: false
+    boundsBehavior: Flickable.StopAtBounds
+
+    property int timestampWidth: 50
+    property int senderWidth: 80
+    property int contentsWidth: width - timestampWidth - senderWidth - 30;
+
     Connections {
       target: msgModel
       onRowsInserted: chatView.positionViewAtEnd();
     }
+/*
+    MouseArea {
+      id: mouseArea
+      anchors.fill: parent
+      acceptedButtons: Qt.LeftButton
+
+      onClicked: {
+        console.log("clicked")
+        parent.senderWidth = parent.senderWidth + 10
+      }
+      onPositionChanged: {
+        console.log("changed" + mouseX + mouseY)
+      }
+
+    }
+*/
 
     Rectangle {
       id: scrollbar