blob: 28a8d737db48ec638829b28f70f857dbfec289f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import QtQuick 1.0
import "custom" as Components
import "plugin"
ScrollArea {
id:area
color: "white"
width: 280
height: 120
contentWidth: 200
property alias text: edit.text
property alias wrapMode: edit.wrapMode
highlightOnFocus: true
TextEdit {
id: edit
text: loremIpsum + loremIpsum;
wrapMode: TextEdit.WordWrap;
width: area.contentWidth
selectByMouse:true
// keep textcursor within scrollarea
onCursorRectangleChanged:
if (cursorRectangle.y >= area.contentY + area.height - 1.5*cursorRectangle.height)
area.contentY = cursorRectangle.y - area.height + 1.5*cursorRectangle.height
else if (cursorRectangle.y < area.contentY)
area.contentY = cursorRectangle.y
}
}
|