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
|
|
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
2023-07-27 12:00:45 +02:00
|
|
|
import HelperWidgets as HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
2023-07-04 19:57:59 +02:00
|
|
|
import StudioTheme as StudioTheme
|
|
|
|
|
import ConnectionsEditorEditorBackend
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
2023-07-27 12:00:45 +02:00
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
color: StudioTheme.Values.themePanelBackground
|
|
|
|
|
|
2023-09-13 17:56:31 +02:00
|
|
|
property bool adsFocus: false
|
|
|
|
|
// objectName is used by the dock widget to find this particular ScrollView
|
|
|
|
|
// and set the ads focus on it.
|
|
|
|
|
objectName: "__mainSrollView"
|
|
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
Column {
|
|
|
|
|
id: column
|
|
|
|
|
anchors.fill: parent
|
2023-10-10 16:50:58 +02:00
|
|
|
spacing: 5 // TODO
|
2023-07-04 19:57:59 +02:00
|
|
|
|
|
|
|
|
Rectangle {
|
2023-07-27 12:00:45 +02:00
|
|
|
id: toolbar
|
|
|
|
|
width: parent.width
|
2023-09-21 10:08:17 +02:00
|
|
|
height: StudioTheme.Values.toolbarHeight
|
2023-07-27 12:00:45 +02:00
|
|
|
color: StudioTheme.Values.themeToolbarBackground
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
Column {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.topMargin: StudioTheme.Values.toolbarVerticalMargin
|
|
|
|
|
anchors.bottomMargin: StudioTheme.Values.toolbarVerticalMargin
|
|
|
|
|
anchors.leftMargin: StudioTheme.Values.toolbarHorizontalMargin
|
|
|
|
|
anchors.rightMargin: StudioTheme.Values.toolbarHorizontalMargin
|
|
|
|
|
spacing: StudioTheme.Values.toolbarColumnSpacing
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-09-21 10:08:17 +02:00
|
|
|
// Temporarily remove search until functionality is provided by backend
|
|
|
|
|
//StudioControls.SearchBox {
|
|
|
|
|
// id: searchBox
|
|
|
|
|
// width: parent.width
|
|
|
|
|
// style: StudioTheme.Values.searchControlStyle
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-09-21 10:08:17 +02:00
|
|
|
// onSearchChanged: function(searchText) {}
|
|
|
|
|
//}
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
Row {
|
|
|
|
|
id: row
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: StudioTheme.Values.toolbarHeight
|
|
|
|
|
spacing: 6
|
|
|
|
|
|
|
|
|
|
TabCheckButton {
|
|
|
|
|
id: connections
|
|
|
|
|
buttonIcon: StudioTheme.Constants.connections_medium
|
|
|
|
|
text: qsTr("Connections")
|
2023-09-18 11:21:24 +02:00
|
|
|
tooltip: qsTr("Sets logical connection between the components and the signals.")
|
2023-07-27 12:00:45 +02:00
|
|
|
checked: true
|
|
|
|
|
autoExclusive: true
|
|
|
|
|
checkable: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TabCheckButton {
|
|
|
|
|
id: bindings
|
|
|
|
|
buttonIcon: StudioTheme.Constants.binding_medium
|
|
|
|
|
text: qsTr("Bindings")
|
2023-09-18 11:21:24 +02:00
|
|
|
tooltip: qsTr("Sets the relation between the properties of two components to bind them together.")
|
2023-07-27 12:00:45 +02:00
|
|
|
autoExclusive: true
|
|
|
|
|
checkable: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TabCheckButton {
|
|
|
|
|
id: properties
|
2023-08-14 11:03:02 +02:00
|
|
|
buttonIcon: StudioTheme.Constants.properties_medium
|
2023-07-27 12:00:45 +02:00
|
|
|
text: qsTr("Properties")
|
2023-09-18 11:21:24 +02:00
|
|
|
tooltip: qsTr("Sets an additional property for the component.")
|
2023-07-27 12:00:45 +02:00
|
|
|
autoExclusive: true
|
|
|
|
|
checkable: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: spacer
|
|
|
|
|
width: row.width - connections.width - bindings.width
|
|
|
|
|
- properties.width - addButton.width - row.spacing * 4
|
|
|
|
|
height: 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
id: addButton
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.add_medium
|
2023-09-18 11:21:24 +02:00
|
|
|
tooltip: qsTr("Adds a Connection, Binding, or Custom Property to the components.")
|
2023-07-27 12:00:45 +02:00
|
|
|
onClicked: {
|
|
|
|
|
if (connections.checked)
|
2023-09-14 16:54:51 +02:00
|
|
|
connectionsListView.addConnection()
|
2023-07-27 12:00:45 +02:00
|
|
|
else if (bindings.checked)
|
2023-09-14 16:54:51 +02:00
|
|
|
bindingsListView.addBinding()
|
2023-07-27 12:00:45 +02:00
|
|
|
else if (properties.checked)
|
2023-09-14 16:54:51 +02:00
|
|
|
propertiesListView.addProperty()
|
2023-07-27 12:00:45 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
ConnectionsListView {
|
2023-09-14 16:54:51 +02:00
|
|
|
id: connectionsListView
|
2023-07-27 12:00:45 +02:00
|
|
|
visible: connections.checked
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height - toolbar.height - column.spacing
|
|
|
|
|
model: ConnectionsEditorEditorBackend.connectionModel
|
2023-09-13 17:56:31 +02:00
|
|
|
adsFocus: root.adsFocus
|
2023-07-27 12:00:45 +02:00
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
BindingsListView {
|
2023-09-14 16:54:51 +02:00
|
|
|
id: bindingsListView
|
2023-07-27 12:00:45 +02:00
|
|
|
visible: bindings.checked
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height - toolbar.height - column.spacing
|
|
|
|
|
model: ConnectionsEditorEditorBackend.bindingModel
|
2023-09-13 17:56:31 +02:00
|
|
|
adsFocus: root.adsFocus
|
2023-07-27 12:00:45 +02:00
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
|
2023-07-27 12:00:45 +02:00
|
|
|
PropertiesListView {
|
2023-09-14 16:54:51 +02:00
|
|
|
id: propertiesListView
|
2023-07-27 12:00:45 +02:00
|
|
|
visible: properties.checked
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height - toolbar.height - column.spacing
|
|
|
|
|
model: ConnectionsEditorEditorBackend.dynamicPropertiesModel
|
2023-09-13 17:56:31 +02:00
|
|
|
adsFocus: root.adsFocus
|
2023-07-27 12:00:45 +02:00
|
|
|
}
|
2023-07-04 19:57:59 +02:00
|
|
|
}
|
|
|
|
|
}
|