From 4032ac6653ca910bb6ffa3aeaaa33dc6630600d4 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 23 Jun 2017 00:29:15 +0200 Subject: Slightly better sizing in the composer --- framework/qml/TextEditor.qml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'framework') diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index 080543f9..9c2298b6 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml @@ -30,15 +30,11 @@ ScrollView { id: flick contentWidth: root.viewport.width - contentHeight: edit.height + contentHeight: Math.max(edit.contentHeight + edit.topPadding + edit.bottomPadding, flick.height) clip: true function ensureVisible(r) { - if (contentX >= r.x) - contentX = r.x; - else if (contentX + width <= r.x + r.width) - contentX = r.x+r.width-width; if (contentY >= r.y) contentY = r.y; else if (contentY + height <= r.y + r.height) @@ -49,10 +45,11 @@ ScrollView { //TODO drop all sizes and use the following once we have qt 5.9 // Controls2.TextArea.flickable: Kube.TextArea { id: edit - width: flick.width - height: edit.contentHeight > flick.height ? edit.contentHeight : flick.height + width: flick.contentWidth - edit.leftPadding - edit.rightPadding + height: flick.contentHeight selectByMouse: true onCursorRectangleChanged: flick.ensureVisible(cursorRectangle) + wrapMode: TextEdit.Wrap } } } -- cgit v1.2.3