EffectComposer: Move open code button

Fixes: QDS-14218
Change-Id: I3f622ef649438475f85bd902d3b2547d64dffdde
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2024-11-26 16:55:07 +02:00
parent f3815c815b
commit 01b8a26fa5
2 changed files with 41 additions and 44 deletions

View File

@@ -725,15 +725,17 @@ Item {
}
Row {
id: buttonRow
width: acceptButton.width + root.horizontalSpacing + cancelButton.width
spacing: root.horizontalSpacing
anchors.horizontalCenter: parent.horizontalCenter
height: 35
x: (parent.width - buttonRow.width) / 2 + 6
height: 30
HelperWidgets.Button {
id: cancelButton
width: 130
height: 35
width: 100
height: 30
text: qsTr("Cancel")
padding: 4
@@ -745,8 +747,8 @@ Item {
HelperWidgets.Button {
id: acceptButton
width: 130
height: 35
width: 100
height: 30
text: qsTr("Apply")
padding: 4
enabled: !root.propNameError && !root.uniNameError

View File

@@ -49,23 +49,6 @@ HelperWidgets.Section {
nodeEnabled = root.eyeEnabled
}
icons: HelperWidgets.IconButton {
id: codeButton
icon: StudioTheme.Constants.codeEditor_medium
transparentBg: true
buttonSize: 21
iconSize: StudioTheme.Values.smallIconFontSize
iconColor: root.codeEditorOpen
? StudioTheme.Values.themeInteraction
: StudioTheme.Values.themeTextColor
iconScale: codeButton.containsMouse ? 1.2 : 1
implicitWidth: width
tooltip: qsTr("Open code editor")
onClicked: root.backendModel.openCodeEditor(index)
visible: !isDependency
}
content: Label {
text: root.caption
color: root.labelColor
@@ -158,28 +141,9 @@ HelperWidgets.Section {
id: addProperty
width: root.width - StudioTheme.Values.scrollBarThicknessHover
height: addPropertyForm.visible && addPropertyForm.parent === addProperty
? addPropertyForm.height : 50
? addPropertyForm.height : 0
visible: !isDependency
HelperWidgets.Button {
id: addPropertyButton
width: 130
height: 35
text: qsTr("Add Property")
visible: !addPropertyForm.visible
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
onClicked: {
confirmRemoveForm.visible = false
confirmRemoveForm.parent = root
root.editedUniformIndex = -1
addPropertyForm.parent = addProperty
addPropertyForm.reservedDispNames = nodeUniformsModel.displayNames()
addPropertyForm.reservedUniNames = root.backendModel.uniformNames()
addPropertyForm.showForAdd()
}
}
AddPropertyForm {
id: addPropertyForm
visible: false
@@ -301,8 +265,39 @@ HelperWidgets.Section {
}
}
}
}
Row {
height: 40
visible: !isDependency && !addPropertyForm.visible
anchors.horizontalCenter: parent.horizontalCenter
spacing: 10
HelperWidgets.Button {
width: 100
height: 30
text: qsTr("Add Property")
enabled: !addPropertyForm.visible
anchors.verticalCenter: parent.verticalCenter
onClicked: {
confirmRemoveForm.visible = false
confirmRemoveForm.parent = root
root.editedUniformIndex = -1
addPropertyForm.parent = addProperty
addPropertyForm.reservedDispNames = nodeUniformsModel.displayNames()
addPropertyForm.reservedUniNames = root.backendModel.uniformNames()
addPropertyForm.showForAdd()
}
}
HelperWidgets.Button {
width: 100
height: 30
text: qsTr("Show Code")
anchors.verticalCenter: parent.verticalCenter
onClicked: root.backendModel.openCodeEditor(index)
}
}
}