aa72fb4c7efc73a0335fa49f40ba82cf4edeb937
[quassel.git] / src / qmlui / qml / ChatView.qml
1 import QtQuick 1.1
2 // import Qt.components 1.0
3
4 import eu.quassel.qmlui 1.0
5
6 Rectangle {
7   id: container
8
9   ListView {
10     id: chatView
11     anchors.fill: parent
12     model: msgModel
13
14     delegate: Component {
15       ChatLine {
16         chatLineData: chatLineDataRole
17       }
18     }
19
20     //interactive: false
21     boundsBehavior: Flickable.StopAtBounds
22
23     property int timestampWidth: 50
24     property int senderWidth: 80
25     property int contentsWidth: width - timestampWidth - senderWidth - 30;
26
27     Connections {
28       target: msgModel
29       onRowsInserted: chatView.positionViewAtEnd();
30     }
31 /*
32     MouseArea {
33       id: mouseArea
34       anchors.fill: parent
35       acceptedButtons: Qt.LeftButton
36
37       onClicked: {
38         console.log("clicked")
39         parent.senderWidth = parent.senderWidth + 10
40       }
41       onPositionChanged: {
42         console.log("changed" + mouseX + mouseY)
43       }
44
45     }
46 */
47
48     Rectangle {
49       id: scrollbar
50       anchors.right: chatView.right
51       y: chatView.visibleArea.yPosition * chatView.height
52       width: 10
53       height: chatView.visibleArea.heightRatio * chatView.height
54       color: "grey"
55     }
56   }
57 }