2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
2023-01-04 08:52:22 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
2013-09-16 16:55:07 +02:00
|
|
|
import HelperWidgets 2.0
|
2019-10-01 10:48:16 +02:00
|
|
|
import StudioControls 1.0 as StudioControls
|
|
|
|
|
import StudioTheme 1.0 as StudioTheme
|
2013-09-16 16:55:07 +02:00
|
|
|
|
|
|
|
|
Section {
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2013-10-08 17:20:05 +02:00
|
|
|
caption: qsTr("Layout")
|
2021-06-21 16:48:19 +02:00
|
|
|
spacing: StudioTheme.Values.sectionRowSpacing + 6
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
LayoutProperties {
|
2015-02-06 10:05:50 +01:00
|
|
|
id: layoutPoperties
|
|
|
|
|
visible: anchorBackend.isInLayout
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
SectionLayout {
|
2015-02-06 10:05:50 +01:00
|
|
|
visible: !anchorBackend.isInLayout
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
PropertyLabel { text: qsTr("Anchors") }
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
SecondColumnLayout {
|
|
|
|
|
Spacer {
|
|
|
|
|
implicitWidth: StudioTheme.Values.actionIndicatorWidth
|
2013-09-16 16:55:07 +02:00
|
|
|
}
|
2014-05-12 11:23:46 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorButtons {}
|
2014-05-12 11:23:46 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
ExpandingSpacer {}
|
2013-09-16 16:55:07 +02:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
}
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorRow {
|
|
|
|
|
visible: anchorBackend.topAnchored
|
|
|
|
|
iconSource: StudioTheme.Constants.anchorTop
|
|
|
|
|
anchorMargin: backendValues.anchors_topMargin
|
|
|
|
|
targetName: anchorBackend.topTarget
|
|
|
|
|
relativeTarget: anchorBackend.relativeAnchorTargetTop
|
|
|
|
|
verticalAnchor: true
|
2014-05-12 11:23:46 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
onTargetChanged: {
|
|
|
|
|
anchorBackend.topTarget = currentText
|
|
|
|
|
}
|
|
|
|
|
onSameEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetTop = AnchorBindingProxy.SameEdge
|
|
|
|
|
}
|
|
|
|
|
onOppositeEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetTop = AnchorBindingProxy.OppositeEdge
|
|
|
|
|
}
|
|
|
|
|
onCenterButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetTop = AnchorBindingProxy.Center
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-05-12 11:23:46 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorRow {
|
|
|
|
|
visible: anchorBackend.bottomAnchored
|
|
|
|
|
iconSource: StudioTheme.Constants.anchorBottom
|
|
|
|
|
anchorMargin: backendValues.anchors_bottomMargin
|
|
|
|
|
targetName: anchorBackend.bottomTarget
|
|
|
|
|
relativeTarget: anchorBackend.relativeAnchorTargetBottom
|
|
|
|
|
verticalAnchor: true
|
|
|
|
|
invertRelativeTargets: true
|
|
|
|
|
|
|
|
|
|
onTargetChanged: {
|
|
|
|
|
anchorBackend.bottomTarget = currentText
|
|
|
|
|
}
|
|
|
|
|
onSameEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetBottom = AnchorBindingProxy.SameEdge
|
2013-09-16 16:55:07 +02:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
onOppositeEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetBottom = AnchorBindingProxy.OppositeEdge
|
|
|
|
|
}
|
|
|
|
|
onCenterButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetBottom = AnchorBindingProxy.Center
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorRow {
|
|
|
|
|
visible: anchorBackend.leftAnchored
|
|
|
|
|
iconSource: StudioTheme.Constants.anchorLeft
|
|
|
|
|
anchorMargin: backendValues.anchors_leftMargin
|
|
|
|
|
targetName: anchorBackend.leftTarget
|
|
|
|
|
relativeTarget: anchorBackend.relativeAnchorTargetLeft
|
|
|
|
|
verticalAnchor: false
|
2014-05-12 11:23:46 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
onTargetChanged: {
|
|
|
|
|
anchorBackend.leftTarget = currentText
|
2013-09-16 16:55:07 +02:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
onSameEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetLeft = AnchorBindingProxy.SameEdge
|
|
|
|
|
}
|
|
|
|
|
onOppositeEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetLeft = AnchorBindingProxy.OppositeEdge
|
|
|
|
|
}
|
|
|
|
|
onCenterButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetLeft = AnchorBindingProxy.Center
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-16 16:55:07 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorRow {
|
|
|
|
|
visible: anchorBackend.rightAnchored
|
|
|
|
|
iconSource: StudioTheme.Constants.anchorRight
|
|
|
|
|
anchorMargin: backendValues.anchors_rightMargin
|
|
|
|
|
targetName: anchorBackend.rightTarget
|
|
|
|
|
relativeTarget: anchorBackend.relativeAnchorTargetRight
|
|
|
|
|
verticalAnchor: false
|
|
|
|
|
invertRelativeTargets: true
|
|
|
|
|
|
|
|
|
|
onTargetChanged: {
|
|
|
|
|
anchorBackend.rightTarget = currentText
|
|
|
|
|
}
|
|
|
|
|
onSameEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetRight = AnchorBindingProxy.SameEdge
|
|
|
|
|
}
|
|
|
|
|
onOppositeEdgeButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetRight = AnchorBindingProxy.OppositeEdge
|
|
|
|
|
}
|
|
|
|
|
onCenterButtonClicked: {
|
|
|
|
|
anchorBackend.relativeAnchorTargetRight = AnchorBindingProxy.Center
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-05-12 11:23:46 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorRow {
|
|
|
|
|
showAlternativeTargets: false
|
|
|
|
|
visible: anchorBackend.horizontalCentered
|
|
|
|
|
iconSource: StudioTheme.Constants.centerHorizontal
|
|
|
|
|
anchorMargin: backendValues.anchors_horizontalCenterOffset
|
|
|
|
|
targetName: anchorBackend.horizontalTarget
|
|
|
|
|
verticalAnchor: false
|
|
|
|
|
buttonRow.visible: false
|
|
|
|
|
|
|
|
|
|
onTargetChanged: {
|
|
|
|
|
anchorBackend.horizontalTarget = currentText
|
2013-10-23 12:15:10 +02:00
|
|
|
}
|
2021-06-21 16:48:19 +02:00
|
|
|
}
|
2013-10-23 12:15:10 +02:00
|
|
|
|
2021-06-21 16:48:19 +02:00
|
|
|
AnchorRow {
|
|
|
|
|
showAlternativeTargets: false
|
|
|
|
|
visible: anchorBackend.verticalCentered
|
|
|
|
|
iconSource: StudioTheme.Constants.centerVertical
|
|
|
|
|
anchorMargin: backendValues.anchors_verticalCenterOffset
|
|
|
|
|
targetName: anchorBackend.verticalTarget
|
|
|
|
|
verticalAnchor: true
|
|
|
|
|
buttonRow.visible: false
|
|
|
|
|
|
|
|
|
|
onTargetChanged: {
|
|
|
|
|
anchorBackend.verticalTarget = currentText
|
2013-10-23 12:15:10 +02:00
|
|
|
}
|
|
|
|
|
}
|
2013-09-16 16:55:07 +02:00
|
|
|
}
|