Move the qml subdir into qmlui
[quassel.git] / src / qmlui / qml / ChatView.qml
1 import QtQuick 1.0
2 // import Qt.components 1.0
3
4 Rectangle {
5   id: container
6
7   Component {
8       id: msgDelegate
9       Item {
10         id: msgDelegateItem
11         Row {
12           id: chatline
13           Text { text: timestamp; wrapMode: Text.NoWrap; width: 100 }
14           Text { text: sender; wrapMode: Text.NoWrap; width: 100 }
15           Text { text: contents; wrapMode: Text.Wrap; width: flickable.width-200}
16         }
17         height: chatline.height
18       }
19   }
20
21   ListView {
22     id: flickable
23     anchors.fill: parent
24
25
26     model: msgModel
27
28     delegate: msgDelegate
29
30     Connections {
31       target: msgModel
32       onRowsInserted: flickable.positionViewAtEnd();
33     }
34
35     Rectangle {
36       id: scrollbar
37       anchors.right: flickable.right
38       y: flickable.visibleArea.yPosition * flickable.height
39       width: 10
40       height: flickable.visibleArea.heightRatio * flickable.height
41       color: "black"
42     }
43   }
44 }