2022-05-13 13:12:05 +00:00
|
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
2024-02-22 14:51:16 +00:00
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
2021-09-03 12:06:51 +00:00
|
|
|
|
import QtQuick
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
2023-03-23 12:25:21 +00:00
|
|
|
|
pragma ComponentBehavior: Bound
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
color: "white"
|
2012-03-07 07:10:14 +00:00
|
|
|
|
width: 320
|
|
|
|
|
height: 480
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
|
|
property bool mirror: false
|
2012-03-07 07:10:14 +00:00
|
|
|
|
property int pxSz: 18
|
2011-04-27 10:05:43 +00:00
|
|
|
|
property variant horizontalAlignment: undefined
|
|
|
|
|
|
2023-03-23 12:25:21 +00:00
|
|
|
|
readonly property variant editorType: [qsTr("Plain Text"), qsTr("Styled Text"), qsTr("Plain Rich Text"), qsTr("Italic Rich Text"), qsTr("Plain TextEdit"), qsTr("Italic TextEdit"), qsTr("TextInput")]
|
|
|
|
|
readonly property variant text: ["", " ", "Hello world!", "مرحبا العالم!", "Hello world! Hello!\nHello world! Hello!", "مرحبا العالم! مرحبا! مرحبا العالم! مرحبا!" ,"مرحبا العالم! مرحبا! مرحبا Hello world!\nالعالم! مرحبا!"]
|
|
|
|
|
readonly property variant description: [qsTr("empty text"), qsTr("white-space-only text"), qsTr("left-to-right text"), qsTr("right-to-left text"), qsTr("multi-line left-to-right text"), qsTr("multi-line right-to-left text"), qsTr("multi-line bidi text")]
|
|
|
|
|
readonly property variant textComponents: [plainTextComponent, styledTextComponent, richTextComponent, italicRichTextComponent, plainTextEdit, italicTextEdit, textInput]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
|
|
function shortText(horizontalAlignment) {
|
|
|
|
|
|
|
|
|
|
// all the different QML editors have
|
|
|
|
|
// the same alignment values
|
|
|
|
|
switch (horizontalAlignment) {
|
|
|
|
|
case Text.AlignLeft:
|
2023-03-23 12:25:21 +00:00
|
|
|
|
return qsTr("L");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
case Text.AlignRight:
|
2023-03-23 12:25:21 +00:00
|
|
|
|
return qsTr("R");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
case Text.AlignHCenter:
|
2023-03-23 12:25:21 +00:00
|
|
|
|
return qsTr("C");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
case Text.AlignJustify:
|
2023-03-23 12:25:21 +00:00
|
|
|
|
return qsTr("J");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
default:
|
2023-03-23 12:25:21 +00:00
|
|
|
|
return qsTr("Error");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-17 16:10:59 +00:00
|
|
|
|
|
2023-03-23 12:25:21 +00:00
|
|
|
|
ListView {
|
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
left: parent.left
|
|
|
|
|
right: parent.right
|
|
|
|
|
bottom: buttons.top
|
|
|
|
|
topMargin: 5
|
|
|
|
|
}
|
|
|
|
|
model: root.editorType.length
|
|
|
|
|
orientation: ListView.Horizontal
|
|
|
|
|
cacheBuffer: 1000 //Load the really expensive ones async if possible
|
|
|
|
|
delegate: Item {
|
|
|
|
|
id: delegate
|
|
|
|
|
|
|
|
|
|
required property int index
|
|
|
|
|
|
|
|
|
|
width: ListView.view.width
|
|
|
|
|
height: ListView.view.height
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
spacing: 5
|
|
|
|
|
width: textColumn.width + 10
|
|
|
|
|
Text {
|
|
|
|
|
text: root.editorType[delegate.index]
|
|
|
|
|
font.pixelSize: 16
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
}
|
2012-03-07 07:10:14 +00:00
|
|
|
|
Column {
|
2023-03-23 12:25:21 +00:00
|
|
|
|
id: textColumn
|
2012-03-07 07:10:14 +00:00
|
|
|
|
spacing: 5
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
Repeater {
|
|
|
|
|
model: root.textComponents.length
|
|
|
|
|
delegate: root.textComponents[delegate.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-23 12:25:21 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: buttons
|
|
|
|
|
spacing: 2
|
|
|
|
|
width: parent.width
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
Rectangle {
|
|
|
|
|
// button
|
|
|
|
|
height: 50
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: parent.width
|
2023-03-23 12:25:21 +00:00
|
|
|
|
color: mouseArea.pressed ? "black" : "lightgray"
|
|
|
|
|
Column {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
Text {
|
|
|
|
|
text: root.mirror ? qsTr("Mirrored") : qsTr("Not mirrored")
|
|
|
|
|
color: "white"
|
|
|
|
|
font.pixelSize: 16
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
2023-03-23 12:25:21 +00:00
|
|
|
|
Text {
|
|
|
|
|
text: qsTr("(click here to toggle)")
|
|
|
|
|
color: "white"
|
|
|
|
|
font.pixelSize: 10
|
|
|
|
|
font.italic: true
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-23 12:25:21 +00:00
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea
|
|
|
|
|
|
|
|
|
|
property int index: 0
|
|
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: root.mirror = !root.mirror
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Rectangle {
|
|
|
|
|
// button
|
|
|
|
|
height: 50
|
|
|
|
|
width: parent.width
|
|
|
|
|
color: mouseArea2.pressed ? "black" : "gray"
|
|
|
|
|
Column {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
Text {
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
color: "white"
|
|
|
|
|
font.pixelSize: 16
|
|
|
|
|
text: {
|
|
|
|
|
if (root.horizontalAlignment == undefined)
|
|
|
|
|
return qsTr("Implict alignment");
|
|
|
|
|
switch (root.horizontalAlignment) {
|
|
|
|
|
case Text.AlignLeft:
|
|
|
|
|
return qsTr("Left alignment");
|
|
|
|
|
case Text.AlignRight:
|
|
|
|
|
return qsTr("Right alignment");
|
|
|
|
|
case Text.AlignHCenter:
|
|
|
|
|
return qsTr("Center alignment");
|
|
|
|
|
case Text.AlignJustify:
|
|
|
|
|
return qsTr("Justify alignment");
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-23 12:25:21 +00:00
|
|
|
|
Text {
|
|
|
|
|
text: qsTr("(click here to toggle)")
|
|
|
|
|
color: "white"
|
|
|
|
|
font.pixelSize: 10
|
|
|
|
|
font.italic: true
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea2
|
|
|
|
|
|
|
|
|
|
property int index: 0
|
|
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.horizontalAlignment = index < 0 ? undefined : Math.pow(2, index)
|
|
|
|
|
index = (index + 2) % 5 - 1;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: plainTextComponent
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
|
|
|
|
text: root.text[index]
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz
|
2011-04-27 10:05:43 +00:00
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
textFormat: Text.RichText
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.description[parent.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: styledTextComponent
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
|
|
|
|
text: root.text[index]
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz
|
2011-04-27 10:05:43 +00:00
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
textFormat: Text.RichText
|
|
|
|
|
style: Text.Sunken
|
|
|
|
|
styleColor: "white"
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.description[parent.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: richTextComponent
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
|
|
|
|
text: root.text[index]
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz
|
2011-04-27 10:05:43 +00:00
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
textFormat: Text.RichText
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.8, 0.2, 0.2, 0.3)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.description[parent.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: italicRichTextComponent
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
|
|
|
|
text: "<i>" + root.text[index] + "</i>"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz
|
2011-04-27 10:05:43 +00:00
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
textFormat: Text.RichText
|
|
|
|
|
property variant backgroundColor: Qt.rgba(0.8, 0.2, 0.2, 0.3)
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: parent.backgroundColor
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.description[parent.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: plainTextEdit
|
|
|
|
|
TextEdit {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
|
|
|
|
text: root.text[index]
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz
|
2011-04-27 10:05:43 +00:00
|
|
|
|
cursorVisible: true
|
|
|
|
|
wrapMode: TextEdit.WordWrap
|
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.5, 0.5, 0.2, 0.3)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.description[parent.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: italicTextEdit
|
|
|
|
|
TextEdit {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
|
|
|
|
text: "<i>" + root.text[index] + "<i>"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz
|
2011-04-27 10:05:43 +00:00
|
|
|
|
cursorVisible: true
|
|
|
|
|
wrapMode: TextEdit.WordWrap
|
2011-12-13 03:56:42 +00:00
|
|
|
|
textFormat: TextEdit.RichText
|
2011-04-27 10:05:43 +00:00
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.5, 0.5, 0.2, 0.3)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.description[parent.index]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
2019-09-17 16:10:59 +00:00
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
2019-09-17 16:10:59 +00:00
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
2023-03-23 12:25:21 +00:00
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: textInput
|
2023-03-23 12:25:21 +00:00
|
|
|
|
TextInput {
|
2019-09-17 16:10:59 +00:00
|
|
|
|
id: textDelegate
|
2023-03-23 12:25:21 +00:00
|
|
|
|
|
2019-09-17 16:10:59 +00:00
|
|
|
|
required property int index
|
2023-03-23 12:25:21 +00:00
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
|
width: 180
|
2023-03-23 12:25:21 +00:00
|
|
|
|
text: root.text[textDelegate.index]
|
|
|
|
|
font.pixelSize: root.pxSz
|
|
|
|
|
cursorVisible: true
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
horizontalAlignment: root.horizontalAlignment
|
|
|
|
|
LayoutMirroring.enabled: root.mirror
|
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
|
|
|
|
color: Qt.rgba(0.6, 0.4, 0.2, 0.3)
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
text: root.description[textDelegate.index]
|
|
|
|
|
color: Qt.rgba(1,1,1,1.0)
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
font.pixelSize: root.pxSz - 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
Rectangle {
|
|
|
|
|
z: -1
|
2023-03-23 12:25:21 +00:00
|
|
|
|
color: Qt.rgba(0.3, 0, 0, 0.3)
|
|
|
|
|
anchors {
|
|
|
|
|
fill: parent
|
|
|
|
|
margins: -3
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-23 12:25:21 +00:00
|
|
|
|
}
|
|
|
|
|
Text {
|
|
|
|
|
color: "white"
|
|
|
|
|
text: root.shortText(parent.horizontalAlignment)
|
|
|
|
|
anchors {
|
|
|
|
|
top: parent.top
|
|
|
|
|
right: parent.right
|
|
|
|
|
margins: 2
|
2011-04-27 10:05:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|