2020-06-17 19:31:01 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-06-10 20:32:04 +00:00
|
|
|
|
2021-10-14 10:24:37 +00:00
|
|
|
import "./controls"
|
2021-10-14 13:09:35 +00:00
|
|
|
import "./panels"
|
2021-10-14 10:24:37 +00:00
|
|
|
|
|
|
|
// TODO: replace with StatusQ components
|
2020-06-10 20:32:04 +00:00
|
|
|
Item {
|
|
|
|
property string text: "My Text"
|
|
|
|
property string label: "My Label"
|
2020-07-02 15:14:31 +00:00
|
|
|
property string fontFamily: Style.current.fontRegular.name
|
2020-07-21 21:03:22 +00:00
|
|
|
property string textToCopy: ""
|
2020-08-06 18:19:26 +00:00
|
|
|
property alias value: textItem
|
2020-08-19 15:58:25 +00:00
|
|
|
property bool wrap: false
|
2020-06-10 20:32:04 +00:00
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
id: infoText
|
2021-01-12 20:51:00 +00:00
|
|
|
implicitHeight: this.childrenRect.height
|
2020-07-21 21:03:22 +00:00
|
|
|
width: parent.width
|
2020-06-10 20:32:04 +00:00
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-06-10 20:32:04 +00:00
|
|
|
id: inputLabel
|
2020-07-21 21:03:22 +00:00
|
|
|
text: infoText.label
|
2020-06-10 20:32:04 +00:00
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 13
|
2021-02-18 19:07:23 +00:00
|
|
|
color: Style.current.secondaryText
|
2020-06-10 20:32:04 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:21:02 +00:00
|
|
|
StyledTextEdit {
|
2020-06-10 20:32:04 +00:00
|
|
|
id: textItem
|
2020-07-21 21:03:22 +00:00
|
|
|
text: infoText.text
|
2020-08-19 15:58:25 +00:00
|
|
|
selectByMouse: true
|
2020-07-01 15:12:46 +00:00
|
|
|
font.family: fontFamily
|
2020-06-10 20:32:04 +00:00
|
|
|
readOnly: true
|
|
|
|
anchors.top: inputLabel.bottom
|
2021-01-12 20:51:00 +00:00
|
|
|
anchors.topMargin: 4
|
2020-06-10 20:32:04 +00:00
|
|
|
font.pixelSize: 15
|
2020-08-19 15:58:25 +00:00
|
|
|
wrapMode: infoText.wrap ? Text.WordWrap : Text.NoWrap
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: infoText.wrap ? parent.right : undefined
|
2020-06-10 20:32:04 +00:00
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
|
2020-08-19 15:58:25 +00:00
|
|
|
Loader {
|
|
|
|
active: !!infoText.textToCopy
|
|
|
|
sourceComponent: copyComponent
|
2020-08-19 17:07:07 +00:00
|
|
|
anchors.verticalCenter: textItem.verticalCenter
|
|
|
|
anchors.left: textItem.right
|
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
2020-08-19 15:58:25 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: copyComponent
|
|
|
|
CopyToClipBoardButton {
|
|
|
|
textToCopy: infoText.textToCopy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-10 20:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff";formeditorZoom:1.25}
|
|
|
|
}
|
|
|
|
##^##*/
|