2023-07-04 19:57:59 +02:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import StudioControls as StudioControls
|
|
|
|
|
import StudioTheme as StudioTheme
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
Column {
|
|
|
|
|
id: root
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
readonly property real horizontalSpacing: 10
|
2023-10-24 12:10:29 +02:00
|
|
|
readonly property real verticalSpacing: 12
|
2023-09-01 17:29:07 +02:00
|
|
|
readonly property real columnWidth: (root.width - root.horizontalSpacing) / 2
|
2023-08-31 16:24:18 +02:00
|
|
|
|
2023-07-04 19:57:59 +02:00
|
|
|
property var backend
|
|
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
width: parent.width
|
|
|
|
|
spacing: root.verticalSpacing
|
2023-08-31 16:24:18 +02:00
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
PopupLabel {
|
|
|
|
|
text: qsTr("Type")
|
2023-09-21 14:48:21 +02:00
|
|
|
tooltip: qsTr("Sets the category of the <b>Local Custom Property</b>.")
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
2023-10-24 12:10:29 +02:00
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
StudioControls.TopLevelComboBox {
|
|
|
|
|
id: type
|
|
|
|
|
style: StudioTheme.Values.connectionPopupControlStyle
|
|
|
|
|
width: root.columnWidth
|
2023-07-04 19:57:59 +02:00
|
|
|
|
|
|
|
|
model: backend.type.model ?? []
|
2023-09-01 17:29:07 +02:00
|
|
|
onActivated: backend.type.activateIndex(type.currentIndex)
|
2023-07-04 19:57:59 +02:00
|
|
|
property int currentTypeIndex: backend.type.currentIndex ?? 0
|
2023-09-01 17:29:07 +02:00
|
|
|
onCurrentTypeIndexChanged: type.currentIndex = type.currentTypeIndex
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
|
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
Row {
|
|
|
|
|
spacing: root.horizontalSpacing
|
|
|
|
|
|
2023-09-15 17:33:00 +02:00
|
|
|
PopupLabel {
|
|
|
|
|
width: root.columnWidth
|
|
|
|
|
text: qsTr("Name")
|
2023-09-21 14:48:21 +02:00
|
|
|
tooltip: qsTr("Sets a name for the <b>Local Custom Property</b>.")
|
2023-09-15 17:33:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PopupLabel {
|
|
|
|
|
width: root.columnWidth
|
|
|
|
|
text: qsTr("Value")
|
2023-09-21 14:48:21 +02:00
|
|
|
tooltip: qsTr("Sets a valid <b>Local Custom Property</b> value.")
|
2023-09-15 17:33:00 +02:00
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
|
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
Row {
|
|
|
|
|
spacing: root.horizontalSpacing
|
2023-10-24 12:10:29 +02:00
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
StudioControls.TextField {
|
|
|
|
|
id: name
|
|
|
|
|
|
|
|
|
|
width: root.columnWidth
|
|
|
|
|
actionIndicatorVisible: false
|
|
|
|
|
translationIndicatorVisible: false
|
|
|
|
|
|
|
|
|
|
text: backend.name.text ?? ""
|
2023-10-24 12:10:29 +02:00
|
|
|
onEditingFinished: backend.name.activateText(name.text)
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
2023-10-24 12:10:29 +02:00
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
StudioControls.TextField {
|
|
|
|
|
id: value
|
|
|
|
|
|
|
|
|
|
width: root.columnWidth
|
|
|
|
|
actionIndicatorVisible: false
|
|
|
|
|
translationIndicatorVisible: false
|
2023-07-04 19:57:59 +02:00
|
|
|
|
|
|
|
|
|
2023-09-01 17:29:07 +02:00
|
|
|
text: backend.value.text ?? ""
|
2023-10-24 12:10:29 +02:00
|
|
|
onEditingFinished: backend.value.activateText(value.text)
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|