mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-15 04:28:04 +08:00

The tutorials say it should work, but it doesn't. Now we make the whole thing a flickable with an attached textarea property, which does seem to work. Contributes to issue CURA-8686.
53 lines
1.4 KiB
QML
53 lines
1.4 KiB
QML
// Copyright (c) 2022 Ultimaker B.V.
|
|
// Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
import QtQuick 2.10
|
|
import QtQuick.Controls 2.3
|
|
|
|
import UM 1.5 as UM
|
|
import Cura 1.1 as Cura
|
|
|
|
|
|
//
|
|
// Cura-style TextArea with scrolls
|
|
//
|
|
Flickable
|
|
{
|
|
id: scrollableTextAreaBase
|
|
property bool do_borders: true
|
|
property var back_color: UM.Theme.getColor("main_background")
|
|
property alias textArea: flickableTextArea
|
|
|
|
ScrollBar.vertical: UM.ScrollBar {}
|
|
|
|
TextArea.flickable: TextArea
|
|
{
|
|
id: flickableTextArea
|
|
|
|
background: Rectangle //Providing the background color and border.
|
|
{
|
|
anchors
|
|
{
|
|
top: parent.top
|
|
topMargin: -border.width
|
|
bottom: parent.bottom
|
|
bottomMargin: -border.width
|
|
left: parent.left
|
|
leftMargin: -border.width
|
|
right: parent.right
|
|
rightMargin: -border.width
|
|
}
|
|
|
|
color: scrollableTextAreaBase.back_color
|
|
border.color: UM.Theme.getColor("thick_lining")
|
|
border.width: scrollableTextAreaBase.do_borders ? UM.Theme.getSize("default_lining").width : 0
|
|
}
|
|
|
|
font: UM.Theme.getFont("default")
|
|
color: UM.Theme.getColor("text")
|
|
textFormat: TextEdit.PlainText
|
|
renderType: Text.NativeRendering
|
|
wrapMode: Text.Wrap
|
|
selectByMouse: true
|
|
}
|
|
} |