diff --git a/gui/main-kf5.qml b/gui/main-kf5.qml index 9b324ae..aa71fd5 100644 --- a/gui/main-kf5.qml +++ b/gui/main-kf5.qml @@ -1861,35 +1861,37 @@ ApplicationWindow { font.pixelSize: Qt.application.font.pixelSize * 0.85 } - ScrollView { - id: outputScroll + Flickable { + id: outputFlick Layout.fillWidth: true Layout.fillHeight: true + clip: true + contentWidth: width + contentHeight: outputArea.implicitHeight + boundsBehavior: Flickable.StopAtBounds property bool atBottom: true + onContentYChanged: { + var bottom = contentHeight - height + atBottom = (bottom <= 0 || contentY >= bottom - 4) + } + + onContentHeightChanged: { + if (atBottom) { + contentY = Math.max(0, contentHeight - height) + } + } + TextArea { id: outputArea + width: outputFlick.width readOnly: true font.family: "monospace" font.pixelSize: Qt.application.font.pixelSize * 0.9 text: processManagerWindow.selectedOutput wrapMode: TextEdit.Wrap - - onTextChanged: { - if (outputScroll.atBottom) { - cursorPosition = length - ensureVisible(length) - } - } - - onCursorRectangleChanged: { - var flickable = outputScroll.contentItem - if (flickable) { - var bottom = flickable.contentHeight - flickable.height - outputScroll.atBottom = (bottom <= 0 || flickable.contentY >= bottom - 4) - } - } + background: null } } } diff --git a/gui/main.qml b/gui/main.qml index 3fbe2f5..e79b592 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -671,35 +671,37 @@ ApplicationWindow { font.pixelSize: Qt.application.font.pixelSize * 0.85 } - ScrollView { - id: outputScroll + Flickable { + id: outputFlick Layout.fillWidth: true Layout.fillHeight: true + clip: true + contentWidth: width + contentHeight: outputArea.implicitHeight + boundsBehavior: Flickable.StopAtBounds property bool atBottom: true + onContentYChanged: { + let bottom = contentHeight - height + atBottom = (bottom <= 0 || contentY >= bottom - 4) + } + + onContentHeightChanged: { + if (atBottom) { + contentY = Math.max(0, contentHeight - height) + } + } + TextArea { id: outputArea + width: outputFlick.width readOnly: true font.family: "monospace" font.pixelSize: Qt.application.font.pixelSize * 0.9 text: processManagerWindow.selectedOutput wrapMode: TextEdit.Wrap - - onTextChanged: { - if (outputScroll.atBottom) { - cursorPosition = length - ensureVisible(length) - } - } - - onCursorRectangleChanged: { - let flickable = outputScroll.contentItem - if (flickable) { - let bottom = flickable.contentHeight - flickable.height - outputScroll.atBottom = (bottom <= 0 || flickable.contentY >= bottom - 4) - } - } + background: null } } }