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