diff options
Diffstat (limited to 'share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets')
12 files changed, 304 insertions, 148 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml index 95788a9ec6..7f1e6f5d46 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml @@ -22,17 +22,25 @@ StudioControls.CheckBox { labelColor: colorLogic.textColor + property bool __block: false + ColorLogic { id: colorLogic backendValue: checkBox.backendValue onValueFromBackendChanged: { + checkBox.__block = true if (colorLogic.valueFromBackend !== undefined && checkBox.checked !== colorLogic.valueFromBackend) checkBox.checked = colorLogic.valueFromBackend + checkBox.__block = false } + } onCheckedChanged: { + if (checkBox.__block) + return + if (backendValue.value !== checkBox.checked) backendValue.value = checkBox.checked } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 4b4d2b8dc6..cc8247d706 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -38,6 +38,10 @@ SecondColumnLayout { property alias showHexTextField: hexTextField.visible property bool shapeGradients: false + + //for now, gradients on MCUs are limited to Basic and Shape Linear Gradient: + property bool mcuGradients: false + property color originalColor property bool isVector3D: false @@ -219,7 +223,10 @@ SecondColumnLayout { function open() { popupDialog.ensureLoader() + popupDialog.show(preview) + + popupDialog.loaderItem.aboutToBeShown() //need it for now } function determineActiveColorMode() { @@ -235,9 +242,11 @@ SecondColumnLayout { sourceComponent: ColorEditorPopup { shapeGradients: colorEditor.shapeGradients + mcuGradients: colorEditor.mcuGradients supportGradient: colorEditor.supportGradient width: popupDialog.contentWidth visible: popupDialog.visible + parentWindow: popupDialog.window } onLoaded: { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditorPopup.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditorPopup.qml index 22be367c37..41f2c433fa 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditorPopup.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditorPopup.qml @@ -12,10 +12,20 @@ import QtQuickDesignerColorPalette Column { id: root + // There seems to be an issue on Windows and MacOS with ColorPickers + // Canvases not being painted on initialization + // because ColorEditorPopup is invisible at init time, + // so we use this signal to explicitly pass visibility status + signal aboutToBeShown + property bool eyeDropperActive: ColorPaletteBackend.eyeDropperActive property bool supportGradient: false property bool shapeGradients: false + + //for now, gradients on MCUs are limited to Basic and Shape Linear Gradient: + property bool mcuGradients: false + property alias gradientLine: gradientLine property alias popupHexTextField: popupHexTextField property alias gradientPropertyName: root.gradientModel.gradientPropertyName @@ -23,6 +33,8 @@ Column { property alias gradientModel: gradientModel + property Window parentWindow: null + property bool isInValidState: false readonly property real twoColumnWidth: (colorColumn.width - StudioTheme.Values.controlGap) * 0.5 @@ -224,12 +236,12 @@ Column { ceMode.items.append({ value: "RadialGradient", text: qsTr("Radial"), - enabled: root.supportGradient && root.shapeGradients + enabled: root.supportGradient && root.shapeGradients && !root.mcuGradients }) ceMode.items.append({ value: "ConicalGradient", text: qsTr("Conical"), - enabled: root.supportGradient && root.shapeGradients + enabled: root.supportGradient && root.shapeGradients && !root.mcuGradients }) } @@ -429,6 +441,13 @@ Column { hsvValueSpinBox.value = colorPicker.value hsvAlphaSpinBox.value = colorPicker.alpha } + + Connections { + target: root + onAboutToBeShown: { + colorPicker.aboutToBeShown() + } + } } Column { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DoubleSpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DoubleSpinBox.qml index a44e8c690b..11ce0e1e75 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DoubleSpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DoubleSpinBox.qml @@ -53,5 +53,6 @@ Item { decimals: 2 onRealValueModified: wrapper.valueModified() + onCompressedRealValueModified: wrapper.valueModified() } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml index 39176ca82a..e0c70ff946 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml @@ -291,53 +291,64 @@ Section { property int vecSize: 0 property var proxyValues: [] property var spinBoxes: [boxX, boxY, boxZ, boxW] + property bool block: false signal remove - onVecSizeChanged: updateProxyValues() + onVecSizeChanged: layoutVector.updateProxyValues() - spacing: StudioTheme.Values.sectionRowSpacing / 2 + spacing: StudioTheme.Values.sectionRowSpacing function isValidValue(v) { return !(v === undefined || isNaN(v)) } - function updateExpression() { + function updateExpressionFromExpression() { + if (layoutVector.block) + return + + layoutVector.backendValue.expression = layoutVector.proxyValues[0].expression + // Only the first proxy value has an expression editor enabled + } + + function updateExpressionFromValue() { + if (layoutVector.block) + return + for (let i = 0; i < vecSize; ++i) { - if (!isValidValue(proxyValues[i].value)) + if (!layoutVector.isValidValue(layoutVector.proxyValues[i].value)) return } - let expStr = "Qt.vector" + vecSize + "d("+proxyValues[0].value - for (let j=1; j < vecSize; ++j) - expStr += ", " + proxyValues[j].value + let expStr = "Qt.vector" + layoutVector.vecSize + "d(" + layoutVector.proxyValues[0].value + for (let j=1; j < layoutVector.vecSize; ++j) + expStr += ", " + layoutVector.proxyValues[j].value expStr += ")" layoutVector.backendValue.expression = expStr } function updateProxyValues() { - if (!backendValue) + if (!layoutVector.backendValue) return; - const startIndex = backendValue.expression.indexOf('(') - const endIndex = backendValue.expression.indexOf(')') - if (startIndex === -1 || endIndex === -1 || endIndex < startIndex) - return - const numberStr = backendValue.expression.slice(startIndex + 1, endIndex) - const numbers = numberStr.split(",") - if (!Array.isArray(numbers) || numbers.length !== vecSize) - return + let vals = layoutVector.backendValue.getExpressionAsVector() - let vals = [] - for (let i = 0; i < vecSize; ++i) { - vals[i] = parseFloat(numbers[i]) - if (!isValidValue(vals[i])) - return + layoutVector.block = true + + if (layoutVector.vecSize === vals.length) { + for (let j = 0; j < layoutVector.vecSize; ++j) { + layoutVector.proxyValues[j].setForceBound(false) + layoutVector.proxyValues[j].value = vals[j] + } + } else { + for (let j = 0; j < layoutVector.vecSize; ++j) { + layoutVector.proxyValues[j].setForceBound(true) // Required since the backendValue is just proxied + layoutVector.proxyValues[j].expression = layoutVector.backendValue.expression + } } - for (let j = 0; j < vecSize; ++j) - proxyValues[j].value = vals[j] + layoutVector.block = false } SecondColumnLayout { @@ -357,15 +368,18 @@ Section { tooltip: "X" } - Spacer { implicitWidth: StudioTheme.Values.controlGap } + Spacer { + implicitWidth: StudioTheme.Values.controlGap + + StudioTheme.Values.actionIndicatorWidth + } SpinBox { id: boxY + actionIndicatorVisible: false minimumValue: -9999999 maximumValue: 9999999 decimals: 2 implicitWidth: StudioTheme.Values.twoControlColumnWidth - + StudioTheme.Values.actionIndicatorWidth } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } @@ -386,14 +400,16 @@ Section { } SecondColumnLayout { - visible: vecSize > 2 + visible: layoutVector.vecSize > 2 + Spacer { implicitWidth: StudioTheme.Values.actionIndicatorWidth } + SpinBox { id: boxZ + actionIndicatorVisible: false minimumValue: -9999999 maximumValue: 9999999 decimals: 2 implicitWidth: StudioTheme.Values.twoControlColumnWidth - + StudioTheme.Values.actionIndicatorWidth } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } @@ -401,19 +417,22 @@ Section { ControlLabel { text: "Z" tooltip: "Z" - visible: vecSize > 2 + visible: layoutVector.vecSize > 2 } - Spacer { implicitWidth: StudioTheme.Values.controlGap } + Spacer { + implicitWidth: StudioTheme.Values.controlGap + + StudioTheme.Values.actionIndicatorWidth + } SpinBox { id: boxW + actionIndicatorVisible: false minimumValue: -9999999 maximumValue: 9999999 decimals: 2 implicitWidth: StudioTheme.Values.twoControlColumnWidth - + StudioTheme.Values.actionIndicatorWidth - visible: vecSize > 3 + visible: layoutVector.vecSize > 3 } Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } @@ -421,7 +440,7 @@ Section { ControlLabel { text: "W" tooltip: "W" - visible: vecSize > 3 + visible: layoutVector.vecSize > 3 } Spacer { implicitWidth: StudioTheme.Values.controlGap } @@ -430,7 +449,7 @@ Section { height: 10 implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth - visible: vecSize === 2 // Placeholder for last spinbox + visible: layoutVector.vecSize === 2 // Placeholder for last spinbox } Spacer { implicitWidth: StudioTheme.Values.twoControlColumnGap } @@ -486,9 +505,12 @@ Section { model: root.propertiesModel row: index } + PropertyLabel { text: propertyName tooltip: propertyType + Layout.alignment: Qt.AlignTop + Layout.topMargin: 6 } Loader { @@ -506,6 +528,8 @@ Section { return intEditor if (propertyType == "real") return realEditor + if (propertyType == "double") + return realEditor if (propertyType == "string") return stringEditor if (propertyType == "bool") @@ -540,7 +564,8 @@ Section { for (let i = 0; i < vecSize; ++i) { var newProxyValue = propertyRow.createProxyBackendValue() loader.item.proxyValues.push(newProxyValue) - newProxyValue.valueChangedQml.connect(loader.item.updateExpression) + newProxyValue.valueChangedQml.connect(loader.item.updateExpressionFromValue) + newProxyValue.expressionChangedQml.connect(loader.item.updateExpressionFromExpression) loader.item.spinBoxes[i].backendValue = newProxyValue } propertyRow.backendValue.expressionChanged.connect(loader.item.updateProxyValues) @@ -685,7 +710,7 @@ Section { StudioControls.ComboBox { id: comboBox actionIndicator.visible: false - model: ["int", "real", "color", "string", "bool", "url", "alias", + model: ["int", "real", "double", "color", "string", "bool", "url", "alias", "signal", "TextureInput", "vector2d", "vector3d", "vector4d"] width: cePopup.itemWidth } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml index 76e6bd8f09..8a8c8c33ce 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml @@ -103,7 +103,7 @@ Item { StudioControls.MenuItem { text: qsTr("Insert Keyframe") enabled: hasActiveTimeline - onTriggered: insertKeyframe(backendValue.name) + onTriggered: backendValue.insertKeyframe() } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlagsComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlagsComboBox.qml index 46c98f25c5..edf17374e2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlagsComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlagsComboBox.qml @@ -132,6 +132,8 @@ StudioControls.CustomComboBox { ExtendedFunctionLogic { id: extFuncLogic backendValue: root.backendValue + + onMenuVisibleChanged: root.popup.visible = false } actionIndicator.icon.color: extFuncLogic.color diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconButton.qml index 008320cb92..4534d3fe7d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconButton.qml @@ -8,9 +8,9 @@ import StudioTheme as StudioTheme Rectangle { id: root - signal clicked() - signal pressed() - signal released() + signal clicked(mouse: var) + signal pressed(mouse: var) + signal released(mouse: var) property alias icon: icon.text property alias tooltip: toolTip.text @@ -30,18 +30,17 @@ Rectangle { property color hoverColor: root.transparentBg ? "transparent" : StudioTheme.Values.themeControlBackgroundHover property color pressColor: root.transparentBg ? "transparent" : StudioTheme.Values.themeControlBackgroundInteraction - width: buttonSize - height: buttonSize + width: root.buttonSize + height: root.buttonSize - color: !enabled ? normalColor - : mouseArea.pressed ? pressColor - : mouseArea.containsMouse ? hoverColor - : normalColor + color: !root.enabled ? root.normalColor + : mouseArea.pressed ? root.pressColor + : mouseArea.containsMouse ? root.hoverColor + : root.normalColor Text { id: icon anchors.centerIn: root - color: root.enabled ? StudioTheme.Values.themeTextColor : StudioTheme.Values.themeTextColorDisabled font.family: StudioTheme.Constants.iconFont.family font.pixelSize: StudioTheme.Values.baseIconFontSize @@ -49,30 +48,29 @@ Rectangle { MouseArea { id: mouseArea - anchors.fill: parent hoverEnabled: root.visible - onClicked: { + onClicked: function(mouse) { // We need to keep mouse area enabled even when button is disabled to make tooltip work if (root.enabled) - root.clicked() + root.clicked(mouse) } - onPressed: { + onPressed: function(mouse) { if (root.enabled) - root.pressed() + root.pressed(mouse) } - onReleased: { + onReleased: function(mouse) { if (root.enabled) - root.released() + root.released(mouse) } } ToolTip { id: toolTip - visible: mouseArea.containsMouse && text !== "" + visible: mouseArea.containsMouse && toolTip.text !== "" delay: 1000 } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyEditorPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyEditorPane.qml index 7046ca48e1..309d815d7a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyEditorPane.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/PropertyEditorPane.qml @@ -19,30 +19,83 @@ Rectangle { default property alias content: mainColumn.children property alias scrollView: mainScrollView + property bool headerDocked: false + readonly property Item headerItem: headerDocked ? dockedHeaderLoader.item : undockedHeaderLoader.item + + property Component headerComponent: null + // Called from C++ to close context menu on focus out function closeContextMenu() { Controller.closeContextMenu() } + Loader { + id: dockedHeaderLoader + + anchors.top: itemPane.top + z: parent.z + 1 + height: item ? item.implicitHeight : 0 + width: parent.width + + active: itemPane.headerDocked + sourceComponent: itemPane.headerComponent + + HeaderBackground{} + } + MouseArea { anchors.fill: parent - onClicked: forceActiveFocus() + onClicked: itemPane.forceActiveFocus() } HelperWidgets.ScrollView { id: mainScrollView - //clip: true - anchors.fill: parent + + clip: true + anchors { + top: dockedHeaderLoader.bottom + bottom: itemPane.bottom + left: itemPane.left + right: itemPane.right + } interactive: !Controller.contextMenuOpened - Column { - id: mainColumn - y: -1 - width: itemPane.width + ColumnLayout { + spacing: 2 + width: mainScrollView.width - onWidthChanged: StudioTheme.Values.responsiveResize(itemPane.width) - Component.onCompleted: StudioTheme.Values.responsiveResize(itemPane.width) + Loader { + id: undockedHeaderLoader + + Layout.fillWidth: true + Layout.preferredHeight: item ? item.implicitHeight : 0 + + active: !itemPane.headerDocked + sourceComponent: itemPane.headerComponent + + HeaderBackground{} + } + + Column { + id: mainColumn + + Layout.fillWidth: true + + onWidthChanged: StudioTheme.Values.responsiveResize(itemPane.width) + Component.onCompleted: StudioTheme.Values.responsiveResize(itemPane.width) + } } } + + component HeaderBackground: Rectangle { + anchors.fill: parent + anchors.leftMargin: -StudioTheme.Values.border + anchors.rightMargin: -StudioTheme.Values.border + z: parent.z - 1 + + color: StudioTheme.Values.themeToolbarBackground + border.color: StudioTheme.Values.themePanelBackground + border.width: StudioTheme.Values.border + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml index dbbb200f73..245b8506a2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml @@ -9,11 +9,13 @@ import StudioTheme as StudioTheme Item { id: section - property alias caption: label.text - property alias labelColor: label.color + + property string caption: "Title" + property color labelColor: StudioTheme.Values.themeTextColor + property int labelCapitalization: Font.AllUppercase property alias sectionHeight: header.height property alias sectionBackgroundColor: header.color - property alias sectionFontSize: label.font.pixelSize + property int sectionFontSize: StudioTheme.Values.myFontSize property alias showTopSeparator: topSeparator.visible property alias showArrow: arrow.visible property alias showLeftBorder: leftBorder.visible @@ -26,6 +28,17 @@ Item { property alias fillBackground: sectionBackground.visible property alias highlightBorder: sectionBorder.visible + property Item content: Controls.Label { + id: label + text: section.caption + color: section.labelColor + elide: Text.ElideRight + font.pixelSize: section.sectionFontSize + font.capitalization: section.labelCapitalization + anchors.verticalCenter: parent?.verticalCenter + textFormat: Text.RichText + } + property int leftPadding: StudioTheme.Values.sectionLeftPadding property int rightPadding: 0 property int topPadding: StudioTheme.Values.sectionHeadSpacerHeight @@ -59,7 +72,7 @@ Item { Connections { target: Controller function onCollapseAll(cat) { - if (collapsible && cat === section.category) { + if (section.collapsible && cat === section.category) { if (section.expandOnClick) section.expanded = false else @@ -106,6 +119,22 @@ Item { onExited: section.dropExit() } + StudioControls.Menu { + id: contextMenu + + StudioControls.MenuItem { + text: qsTr("Expand All") + onTriggered: Controller.expandAll(section.category) + } + + StudioControls.MenuItem { + text: qsTr("Collapse All") + onTriggered: Controller.collapseAll(section.category) + } + + onOpenedChanged: Controller.contextMenuOpened = contextMenu.opened + } + Rectangle { id: header height: section.hideHeader ? 0 : StudioTheme.Values.sectionHeadHeight @@ -116,43 +145,6 @@ Item { : Qt.lighter(StudioTheme.Values.themeSectionHeadBackground, 1.0 + (0.2 * section.level)) - Item { - StudioControls.Menu { - id: contextMenu - - StudioControls.MenuItem { - text: qsTr("Expand All") - onTriggered: Controller.expandAll(section.category) - } - - StudioControls.MenuItem { - text: qsTr("Collapse All") - onTriggered: Controller.collapseAll(section.category) - } - - onOpenedChanged: Controller.contextMenuOpened = contextMenu.opened - } - } - - Image { - id: arrow - width: 8 - height: 4 - source: "image://icons/down-arrow" - anchors.left: parent.left - anchors.leftMargin: 4 + (section.level * section.levelShift) + (section.draggable ? 20 : 0) + (section.showEyeButton ? 25 : 0) - anchors.verticalCenter: parent.verticalCenter - } - - Controls.Label { - id: label - anchors.verticalCenter: parent.verticalCenter - color: StudioTheme.Values.themeTextColor - x: arrow.x + 18 - font.pixelSize: StudioTheme.Values.myFontSize - font.capitalization: Font.AllUppercase - } - MouseArea { id: mouseArea anchors.fill: parent @@ -173,58 +165,102 @@ Item { } } - IconButton { - id: closeButton + RowLayout { + spacing: 1 + anchors.fill: parent - icon: StudioTheme.Constants.closeCross - buttonSize: 22 - iconScale: containsMouse ? 1.2 : 1 - transparentBg: true - anchors.right: parent.right - anchors.rightMargin: 10 - visible: false + IconButton { + id: dragButton + visible: false + icon: StudioTheme.Constants.dragmarks + buttonSize: 21 + iconScale: dragButton.enabled && dragButton.containsMouse ? 1.2 : 1 + transparentBg: true - onClicked: root.closeButtonClicked() - } + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: dragButton.width + Layout.maximumWidth: dragButton.width + + drag.target: dragButton.enabled ? section : null + drag.axis: Drag.YAxis + + onPressed: { + section.startDrag(section) + section.z = ++section.parent.z // put the dragged section on top + } - IconButton { - id: dragButton + onReleased: { + section.stopDrag() + } + } - icon: StudioTheme.Constants.dragmarks - buttonSize: 22 - iconScale: dragButton.enabled && dragButton.containsMouse ? 1.2 : 1 - transparentBg: true + IconButton { + id: eyeButton - visible: false - drag.target: dragButton.enabled ? section : null - drag.axis: Drag.YAxis + visible: false + icon: section.eyeEnabled ? StudioTheme.Constants.visible_small + : StudioTheme.Constants.invisible_small + buttonSize: 21 + iconScale: eyeButton.containsMouse ? 1.2 : 1 + transparentBg: true - onPressed: { - section.startDrag(section) + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: eyeButton.width + Layout.maximumWidth: eyeButton.width - section.z = ++section.parent.z // put the dragged section on top + onClicked: { + section.eyeEnabled = !section.eyeEnabled + section.eyeButtonClicked() + } } - onReleased: { - section.stopDrag() + IconButton { + id: arrow + icon: StudioTheme.Constants.sectionToggle + transparentBg: true + + buttonSize: 21 + iconSize: StudioTheme.Values.smallIconFontSize + iconColor: StudioTheme.Values.themeTextColor + + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: arrow.width + Layout.maximumWidth: arrow.width + + onClicked: function(mouse) { + if (!section.collapsible && section.expanded) + return + + transition.enabled = true + if (section.expandOnClick) + section.expanded = !section.expanded + else + section.toggleExpand() + } } - } - IconButton { - id: eyeButton + Item { + id: headerContent + height: header.height + Layout.fillWidth: true + children: [ section.content ] + } - anchors.left: dragButton.right + IconButton { + id: closeButton - icon: section.eyeEnabled ? StudioTheme.Constants.visible_small : StudioTheme.Constants.invisible_small - buttonSize: 22 - iconScale: eyeButton.containsMouse ? 1.2 : 1 - transparentBg: true + visible: false + icon: StudioTheme.Constants.closeCross + buttonSize: 21 + iconScale: closeButton.containsMouse ? 1.2 : 1 + transparentBg: true - visible: false + Layout.alignment: Qt.AlignVCenter + Layout.preferredWidth: closeButton.width + Layout.maximumWidth: closeButton.width + Layout.rightMargin: 10 - onClicked: { - section.eyeEnabled = !section.eyeEnabled - root.eyeButtonClicked() + onClicked: section.closeButtonClicked() } } } @@ -266,6 +302,7 @@ Item { border.width: 1 visible: false } + Item { id: topSpacer height: section.addTopPadding && column.height > 0 ? section.topPadding : 0 @@ -285,7 +322,7 @@ Item { id: leftBorder visible: false width: 1 - height: parent.height - bottomPadding + height: parent.height - section.bottomPadding color: header.color } @@ -320,8 +357,8 @@ Item { } onRunningChanged: { - if (!running) - enabled = false + if (!transition.running) + transition.enabled = false } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml index f125c459c5..04cbb78f35 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml @@ -22,6 +22,9 @@ Item { property alias realDragRange: spinBox.realDragRange property alias pixelsPerUnit: spinBox.pixelsPerUnit + property alias actionIndicatorEnabled: spinBox.actionIndicator.enabled + property alias actionIndicatorVisible: spinBox.actionIndicatorVisible + width: 96 implicitHeight: spinBox.height diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml index c73e736ef4..8dadd1db2c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml @@ -448,9 +448,10 @@ Row { for (var j = 0; j < myModel.length; ++j) { let item = myModel[j] if (root.hideDuplicates && nameMap.has(item.fileName)) { - // Prefer hiding imported asset files rather than other project files + // Prefer hiding generated component files rather than other project files let listIndex = nameMap.get(item.fileName) - if (comboBox.listModel.get(listIndex).absoluteFilePath.includes("/asset_imports/")) { + let absPath = comboBox.listModel.get(listIndex).absoluteFilePath + if (absPath.includes("/Generated/") || absPath.includes("/asset_imports/")) { comboBox.listModel.set(listIndex, { absoluteFilePath: item.absoluteFilePath, relativeFilePath: item.relativeFilePath, |