From 3aae7ad1ec8dcde6b41123f1f9166a6c2365251f Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 30 Aug 2015 18:27:23 +0200 Subject: Make command output selectable and rich by default --- src/command/CommandInput.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/command/CommandInput.qml b/src/command/CommandInput.qml index 3e6c46c..502f0ae 100644 --- a/src/command/CommandInput.qml +++ b/src/command/CommandInput.qml @@ -84,7 +84,7 @@ Item { } } - Text { + TextEdit { id: output Layout.fillWidth: true @@ -95,10 +95,18 @@ Item { pointSize: settings.command.fontSize } - color: settings.command.fontColor + color: settings.command.fontColor + selectionColor: settings.command.fontColor + selectedTextColor: settings.command.background + + selectByMouse: true + readOnly: true + + textFormat: TextEdit.RichText + wrapMode: TextEdit.NoWrap function isInitial() { - return text === ''; + return length === 0; } function initialize() { @@ -109,7 +117,7 @@ Item { if ( isInitial() ) { text = msg; } else { - text += '
' + msg; + text += '\n' + msg; } } -- cgit v1.2.3