QmlDesigner: Fix Connections Popup layout

* Set proper width on labels
* Set proper width on StatementEditor
* Forward backend property into StatementEditor

Change-Id: Ia0db6ff7f235bd8d25eb0f36124fa158b76aaf04
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Henning Gruendl
2023-09-15 17:33:00 +02:00
committed by Henning Gründl
parent 55034b1cde
commit 9b2d6f5edd
5 changed files with 85 additions and 18 deletions

View File

@@ -22,8 +22,17 @@ Column {
Row { Row {
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("From") ; tooltip: qsTr("The Property to assign from.")} PopupLabel {
PopupLabel { text: qsTr("To"); tooltip: qsTr("The Property to assign to.") } width: root.columnWidth
text: qsTr("From")
tooltip: qsTr("The Property to assign from.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("To")
tooltip: qsTr("The Property to assign to.")
}
} }
Row { Row {

View File

@@ -27,8 +27,17 @@ Column {
Row { Row {
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("Signal"); tooltip: qsTr("The name of the signal.") } PopupLabel {
PopupLabel { text: qsTr("Action"); tooltip: qsTr("The type of the action.") } width: root.columnWidth
text: qsTr("Signal")
tooltip: qsTr("The name of the signal.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("Action")
tooltip: qsTr("The type of the action.")
}
} }
Row { Row {
@@ -93,10 +102,12 @@ Column {
} }
StatementEditor { StatementEditor {
width: root.width
actionType: action.currentValue ?? ConnectionModelStatementDelegate.Custom actionType: action.currentValue ?? ConnectionModelStatementDelegate.Custom
horizontalSpacing: root.horizontalSpacing horizontalSpacing: root.horizontalSpacing
columnWidth: root.columnWidth columnWidth: root.columnWidth
statement: backend.okStatement statement: backend.okStatement
backend: root.backend
spacing: root.verticalSpacing spacing: root.verticalSpacing
} }
@@ -190,10 +201,12 @@ Column {
//Else Statement //Else Statement
StatementEditor { StatementEditor {
width: root.width
actionType: action.currentValue ?? ConnectionModelStatementDelegate.Custom actionType: action.currentValue ?? ConnectionModelStatementDelegate.Custom
horizontalSpacing: root.horizontalSpacing horizontalSpacing: root.horizontalSpacing
columnWidth: root.columnWidth columnWidth: root.columnWidth
statement: backend.koStatement statement: backend.koStatement
backend: root.backend
spacing: root.verticalSpacing spacing: root.verticalSpacing
visible: action.currentValue !== ConnectionModelStatementDelegate.Custom visible: action.currentValue !== ConnectionModelStatementDelegate.Custom
&& backend.hasCondition && backend.hasElse && backend.hasCondition && backend.hasElse

View File

@@ -8,10 +8,10 @@ import StudioControls as StudioControls
import StudioTheme as StudioTheme import StudioTheme as StudioTheme
Text { Text {
width: root.columnWidth
color: StudioTheme.Values.themeTextColor color: StudioTheme.Values.themeTextColor
font.pixelSize: StudioTheme.Values.myFontSize font.pixelSize: StudioTheme.Values.myFontSize
property alias tooltip: area.tooltip property alias tooltip: area.tooltip
HelperWidgets.ToolTipArea { HelperWidgets.ToolTipArea {
id: area id: area
anchors.fill: parent anchors.fill: parent

View File

@@ -38,8 +38,17 @@ Column {
Row { Row {
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("Name") ; tooltip: qsTr("The name of the property.")} PopupLabel {
PopupLabel { text: qsTr("Value"); tooltip: qsTr("The value of the property.") } width: root.columnWidth
text: qsTr("Name")
tooltip: qsTr("The name of the property.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("Value")
tooltip: qsTr("The value of the property.")
}
} }
Row { Row {

View File

@@ -18,16 +18,24 @@ Column {
property var statement property var statement
//implicitWidth: Math.max(16, container.childrenRect.width + container.childrenRect.x) property var backend
//implicitHeight: Math.max(16, container.childrenRect.height + container.childrenRect.y)
// Call Function // Call Function
Row { Row {
visible: root.actionType === ConnectionModelStatementDelegate.CallFunction visible: root.actionType === ConnectionModelStatementDelegate.CallFunction
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("Item") ; tooltip: qsTr("The target item of the function.")} PopupLabel {
PopupLabel { text: qsTr("Method") ; tooltip: qsTr("The name of the function.")} width: root.columnWidth
text: qsTr("Item")
tooltip: qsTr("The target item of the function.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("Method")
tooltip: qsTr("The name of the function.")
}
} }
Row { Row {
@@ -46,7 +54,7 @@ Column {
onCurrentTypeIndexChanged: functionId.currentIndex = functionId.currentTypeIndex onCurrentTypeIndexChanged: functionId.currentIndex = functionId.currentTypeIndex
} }
StudioControls.TopLevelComboBox { StudioControls.TopLevelComboBox {
id: functionName id: functionName
style: StudioTheme.Values.connectionPopupControlStyle style: StudioTheme.Values.connectionPopupControlStyle
width: root.columnWidth width: root.columnWidth
@@ -63,8 +71,16 @@ Column {
visible: root.actionType === ConnectionModelStatementDelegate.Assign visible: root.actionType === ConnectionModelStatementDelegate.Assign
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("From") ; tooltip: qsTr("The Property to assign from.")} PopupLabel {
PopupLabel { text: qsTr("To"); tooltip: qsTr("The Property to assign to.") } width: root.columnWidth
text: qsTr("From")
tooltip: qsTr("The Property to assign from.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("To")
tooltip: qsTr("The Property to assign to.")
}
} }
Row { Row {
@@ -132,8 +148,17 @@ Column {
visible: root.actionType === ConnectionModelStatementDelegate.ChangeState visible: root.actionType === ConnectionModelStatementDelegate.ChangeState
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("State Group"); tooltip: qsTr("The State Group.") } PopupLabel {
PopupLabel { text: qsTr("State"); tooltip: qsTr("The State .") } width: root.columnWidth
text: qsTr("State Group")
tooltip: qsTr("The State Group.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("State")
tooltip: qsTr("The State .")
}
} }
Row { Row {
@@ -169,8 +194,17 @@ Column {
visible: root.actionType === ConnectionModelStatementDelegate.SetProperty visible: root.actionType === ConnectionModelStatementDelegate.SetProperty
spacing: root.horizontalSpacing spacing: root.horizontalSpacing
PopupLabel { text: qsTr("Item"); tooltip: qsTr("The Item.")} PopupLabel {
PopupLabel { text: qsTr("Property"); tooltip: qsTr("The property of the item.")} width: root.columnWidth
text: qsTr("Item")
tooltip: qsTr("The Item.")
}
PopupLabel {
width: root.columnWidth
text: qsTr("Property")
tooltip: qsTr("The property of the item.")
}
} }
Row { Row {
@@ -203,6 +237,7 @@ Column {
} }
PopupLabel { PopupLabel {
width: root.columnWidth
visible: root.actionType === ConnectionModelStatementDelegate.SetProperty visible: root.actionType === ConnectionModelStatementDelegate.SetProperty
text: qsTr("Value") text: qsTr("Value")
} }
@@ -222,6 +257,7 @@ Column {
// Print Message // Print Message
PopupLabel { PopupLabel {
width: root.columnWidth
visible: root.actionType === ConnectionModelStatementDelegate.PrintMessage visible: root.actionType === ConnectionModelStatementDelegate.PrintMessage
text: qsTr("Message") text: qsTr("Message")
tooltip: qsTr("The message that is printed.") tooltip: qsTr("The message that is printed.")