diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml index f8925d00617..eda4d58b51e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ActionIndicator.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import StudioControls 1.0 as StudioControls StudioControls.ActionIndicator { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml index f85b32ca6f8..45266780b6c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import HelperWidgets 2.0 import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme @@ -32,9 +32,9 @@ Row { id: alignmentHorizontalButtons property bool blueHighlight: false - property variant backendValue: backendValues.horizontalAlignment; + property variant backendValue: backendValues.horizontalAlignment property variant value: backendValue.enumeration - property bool baseStateFlag: isBaseState; + property bool baseStateFlag: isBaseState property color __currentColor: blueHighlight ? StudioTheme.Values.themeIconColorInteraction : StudioTheme.Values.themeIconColor diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml index ba95a23d660..0896c67a18e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import HelperWidgets 2.0 import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme @@ -32,13 +32,9 @@ Row { id: alignmentVerticalButtons property bool blueHighlight: false - - property variant backendValue: backendValues.verticalAlignment; - + property variant backendValue: backendValues.verticalAlignment property variant value: backendValue.enumeration - - property bool baseStateFlag: isBaseState; - + property bool baseStateFlag: isBaseState property color __currentColor: blueHighlight ? StudioTheme.Values.themeIconColorInteraction : StudioTheme.Values.themeIconColor @@ -48,37 +44,32 @@ Row { buttonAlignBottom.checked = false if (value !== undefined) { - if (value === "AlignTop") { + if (value === "AlignTop") buttonAlignTop.checked = true - } else if (value === "AlignVCenter") { + else if (value === "AlignVCenter") buttonAlignVCenter.checked = true - } else if (value === "AlignBottom") { + else if (value === "AlignBottom") buttonAlignBottom.checked = true - } } evaluate() } - property bool isInModel: backendValue.isInModel; - onIsInModelChanged: { - evaluate(); - } - property bool isInSubState: backendValue.isInSubState; - onIsInSubStateChanged: { - evaluate(); - } + property bool isInModel: backendValue.isInModel + onIsInModelChanged: evaluate() + property bool isInSubState: backendValue.isInSubState + onIsInSubStateChanged: evaluate() function evaluate() { if (baseStateFlag) { if (backendValue !== null && backendValue.isInModel) - blueHighlight = true; + blueHighlight = true else - blueHighlight = false; + blueHighlight = false } else { if (backendValue !== null && backendValue.isInSubState) - blueHighlight = true; + blueHighlight = true else - blueHighlight = false; + blueHighlight = false } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Button.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Button.qml index 45ee8e65724..53a331591ea 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Button.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Button.qml @@ -69,7 +69,7 @@ T.AbstractButton { }, State { name: "hovered" - when: myButton.hovered && !myButton.pressed + when: myButton.enabled && myButton.hovered && !myButton.pressed PropertyChanges { target: buttonBackground color: StudioTheme.Values.themeControlBackgroundHover @@ -77,7 +77,7 @@ T.AbstractButton { }, State { name: "pressed" - when: myButton.hovered && myButton.pressed + when: myButton.enabled && myButton.hovered && myButton.pressed PropertyChanges { target: buttonBackground color: StudioTheme.Values.themeControlBackgroundInteraction diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow.qml index 28851f28c40..068462441dd 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import QtQuick.Layouts 1.0 RowLayout { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow2.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow2.qml index 39d8159184d..3a971b3d922 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow2.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRow2.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,22 +23,15 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import QtQuick.Layouts 1.0 Row { - id: buttonRow property bool exclusive: false - property int initalChecked: 0 - property int checkedIndex: 0 signal toggled (int index, bool checked) - - Component.onCompleted: { - } - } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRowButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRowButton.qml index ffac673a3e3..e6151e7181d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRowButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ButtonRowButton.qml @@ -30,44 +30,40 @@ import StudioTheme 1.0 as StudioTheme Item { id: buttonRowButton + + property int leftPadding: 0 property bool checked: false - property bool roundLeftButton: true - property alias iconSource: image.source + property alias tooltip: toolTipArea.tooltip signal clicked() - signal doubleClicked() - property alias tooltip: toolTipArea.tooltip - width: StudioTheme.Values.height + leftPadding height: StudioTheme.Values.height - property int leftPadding: 0 - function index() { for (var i = 0; i < parent.children.length; i++) { if (parent.children[i] === buttonRowButton) - return i; + return i } - return -1; + return -1 } function isFirst() { - return index() === 0; + return index() === 0 } function isLast() { - return index() === (parent.children.length - 1); + return index() === (parent.children.length - 1) } Item { anchors.fill: parent + RoundedPanel { roundLeft: isFirst() && buttonRowButton.roundLeftButton - anchors.fill: parent visible: checked color: StudioTheme.Values.themeControlBackgroundInteraction @@ -75,7 +71,6 @@ Item { RoundedPanel { roundLeft: isFirst() - anchors.fill: parent visible: !checked color: StudioTheme.Values.themeControlBackground diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 89d1a35aa04..22f8e340532 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -635,7 +635,7 @@ SecondColumnLayout { anchors.fill: parent tooltip: originalColorRectangle.color acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { + onClicked: function(mouse) { if (mouse.button === Qt.LeftButton) colorEditor.color = colorEditor.originalColor @@ -667,7 +667,7 @@ SecondColumnLayout { anchors.fill: parent tooltip: newColorRectangle.color acceptedButtons: Qt.RightButton - onClicked: { + onClicked: function(mouse) { if (mouse.button === Qt.RightButton) { contextMenuFavorite.currentColor = colorEditor.color contextMenuFavorite.popup() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPalette.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPalette.qml index 6d1d9a42faf..4ff74c7aa73 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPalette.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPalette.qml @@ -77,7 +77,7 @@ Column { acceptedButtons: Qt.LeftButton | Qt.RightButton tooltip: modelData - onClicked: { + onClicked: function(mouse) { if (mouse.button === Qt.LeftButton) root.selectedColor = colorRectangle.color diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPicker.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPicker.qml index e1296123483..07fc29a64d3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPicker.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorPicker.qml @@ -206,7 +206,7 @@ Column { preventStealing: true acceptedButtons: Qt.LeftButton | Qt.RightButton - onPositionChanged: { + onPositionChanged: function(mouse) { if (pressed && mouse.buttons === Qt.LeftButton) { var xx = Math.max(0, Math.min(mouse.x, parent.width)) var yy = Math.max(0, Math.min(mouse.y, parent.height)) @@ -215,15 +215,15 @@ Column { root.saturation = xx / parent.width } } - onPressed: { + onPressed: function(mouse) { if (mouse.button === Qt.LeftButton) positionChanged(mouse) } - onReleased: { + onReleased: function(mouse) { if (mouse.button === Qt.LeftButton) root.updateColor() } - onClicked: { + onClicked: function(mouse) { if (mouse.button === Qt.RightButton) root.rightMouseButtonClicked() } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml index 982651a11ad..87e9a7e3c02 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExpressionTextField.qml @@ -159,7 +159,7 @@ StudioControls.TextField { onPressed: listView.model = null Keys.priority: Keys.BeforeItem - Keys.onPressed: { + Keys.onPressed: function(event) { var text = textField.text var pos = textField.cursorPosition var explicitComplete = true @@ -220,7 +220,7 @@ StudioControls.TextField { listView.model = list } - Keys.onSpacePressed: { + Keys.onSpacePressed: function(event) { if (event.modifiers & Qt.ControlModifier) { var list = autoComplete(textField.text, textField.cursorPosition, true, textField.completeOnlyTypes) textField.prefix = textField.text.substring(0, textField.cursorPosition) @@ -236,7 +236,7 @@ StudioControls.TextField { } } - Keys.onReturnPressed: { + Keys.onReturnPressed: function(event) { event.accepted = false if (textField.completionActive) { textField.commitCompletion() @@ -244,7 +244,7 @@ StudioControls.TextField { } } - Keys.onEscapePressed: { + Keys.onEscapePressed: function(event) { event.accepted = true if (textField.completionActive) { listView.model = null @@ -253,12 +253,12 @@ StudioControls.TextField { } } - Keys.onUpPressed: { + Keys.onUpPressed: function(event) { listView.decrementCurrentIndex() event.accepted = false } - Keys.onDownPressed: { + Keys.onDownPressed: function(event) { listView.incrementCurrentIndex() event.accepted = false } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml index 3cd452b1db4..94308e63b3b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme import QtQuickDesignerTheme 1.0 @@ -70,17 +70,9 @@ Item { } } - onBackendValueChanged: { - setIcon() - } - - onIsBoundBackendChanged: { - setIcon() - } - - onBackendExpressionChanged: { - setIcon() - } + onBackendValueChanged: setIcon() + onIsBoundBackendChanged: setIcon() + onBackendExpressionChanged: setIcon() Loader { id: menuLoader @@ -101,15 +93,11 @@ Item { exportMenuItem.enabled = !backendValue.isAttachedProperty() extendedFunctionButton.menuVisible = true } - onAboutToHide: { - extendedFunctionButton.menuVisible = false - } + onAboutToHide: extendedFunctionButton.menuVisible = false Connections { target: modelNodeBackend - onSelectionChanged: { - menu.close() - } + onSelectionChanged: menu.close() } StudioControls.MenuItem { @@ -121,20 +109,22 @@ Item { extendedFunctionButton.reseted() } } + StudioControls.MenuItem { text: qsTr("Set Binding") onTriggered: expressionDialogLoader.show() } + StudioControls.MenuItem { id: exportMenuItem text: qsTr("Export Property as Alias") + checkable: true onTriggered: { if (checked) backendValue.exportPopertyAsAlias() else backendValue.removeAliasExport() } - checkable: true } StudioControls.MenuItem { @@ -150,13 +140,13 @@ Item { id: expressionDialogLoader parent: itemPane anchors.fill: parent - visible: false active: visible function show() { expressionDialogLoader.visible = true } + sourceComponent: Item { id: bindingEditorParent @@ -176,6 +166,7 @@ Item { hideWidget() expressionDialogLoader.visible = false } + onAccepted: { backendValue.expression = bindingEditor.text.trim() hideWidget() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml index 8221c57b2f7..8294068ccfd 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontComboBox.qml @@ -34,6 +34,7 @@ StudioControls.ComboBox { property variant backendValue property color textColor: colorLogic.textColor property string fontFilter: "*.ttf *.otf" + property bool showExtendedFunctionButton: true labelColor: colorLogic.textColor editable: true @@ -63,9 +64,7 @@ StudioControls.ComboBox { comboBox.model = familyNames } - onModelChanged: { - editText = comboBox.backendValue.valueToString - } + onModelChanged: editText = comboBox.backendValue.valueToString ExtendedFunctionLogic { id: extFuncLogic @@ -76,18 +75,13 @@ StudioControls.ComboBox { actionIndicator.icon.text: extFuncLogic.glyph actionIndicator.onClicked: extFuncLogic.show() actionIndicator.forceVisible: extFuncLogic.menuVisible - - property bool showExtendedFunctionButton: true - - actionIndicator.visible: showExtendedFunctionButton + actionIndicator.visible: comboBox.showExtendedFunctionButton ColorLogic { id: colorLogic - backendValue: comboBox.backendValue property string textValue: comboBox.backendValue.valueToString - onTextValueChanged: { - comboBox.editText = textValue - } + backendValue: comboBox.backendValue + onTextValueChanged: comboBox.editText = colorLogic.textValue } onAccepted: { @@ -124,7 +118,7 @@ StudioControls.ComboBox { Component.onCompleted: { setupModel() - //Hack to style the text input + // Hack to style the text input for (var i = 0; i < comboBox.children.length; i++) { if (comboBox.children[i].text !== undefined) { comboBox.children[i].color = comboBox.textColor @@ -135,7 +129,7 @@ StudioControls.ComboBox { } function setColor() { - //Hack to style the text input + // Hack to style the text input for (var i = 0; i < comboBox.children.length; i++) { if (comboBox.children[i].text !== undefined) { comboBox.children[i].color = comboBox.textColor diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml index dae40f85343..ae4d6535694 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 import QtQuick.Layouts 1.0 import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml index 1f617e44377..4212bfa2483 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Layouts 1.0 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 Image { id: root diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetList.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetList.qml index 345b0ba2cd3..72446ff5600 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetList.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetList.qml @@ -81,12 +81,8 @@ HelperWindow { Layout.fillWidth: true - StudioControls.TabButton { - text: qsTr("System Presets") - } - StudioControls.TabButton { - text: qsTr("User Presets") - } + StudioControls.TabButton { text: qsTr("System Presets") } + StudioControls.TabButton { text: qsTr("User Presets") } } StackLayout { @@ -103,11 +99,13 @@ HelperWindow { id: customTabContent viewModel: customPresetListModel editableName: true - onPresetNameChanged: customPresetListModel.changePresetName(id, name) + onPresetNameChanged: function(id, name) { + customPresetListModel.changePresetName(id, name) + } property int deleteId - onDeleteButtonClicked: { + onDeleteButtonClicked: function(id) { deleteId = id deleteDialog.open() } @@ -116,7 +114,7 @@ HelperWindow { id: deleteDialog visible: false modality: Qt.WindowModal - buttons: StandardButton.No | StandardButton.Yes + buttons: StandardButton.No | StandardButton.Yes title: qsTr("Delete preset?") text: qsTr("Are you sure you want to delete this preset?") onAccepted: customPresetListModel.deletePreset(customTabContent.deleteId) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetTabContent.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetTabContent.qml index 111fe061169..b87b3703db4 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetTabContent.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPresetTabContent.qml @@ -171,12 +171,12 @@ Rectangle { } Component.onCompleted: { - var stopsAmount = stopListSize; - var newStops = []; - for (var i = 0; i < stopsAmount; i++) { - newStops.push( stopComponent.createObject(showGr, { "position": stopsPosList[i], "color": stopsColorList[i] }) ); - } - showGr.stops = newStops; + var stopsAmount = stopListSize + var newStops = [] + for (var i = 0; i < stopsAmount; i++) + newStops.push( stopComponent.createObject(showGr, { "position": stopsPosList[i], "color": stopsColorList[i] }) ) + + showGr.stops = newStops } AbstractButton { @@ -267,7 +267,7 @@ Rectangle { presetNameBox.edit = false } - Keys.onPressed: { + Keys.onPressed:function(event) { if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) { event.accepted = true nameInput.editingFinished() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml index de73742af0e..50c930d64b5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick 2.15 import StudioTheme 1.0 as StudioTheme Item { @@ -105,9 +105,8 @@ Item { onPressed: calculateValue() onReleased: root.clicked() onPositionChanged: { - if (pressed) { + if (pressed) calculateValue() - } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconIndicator.qml index ee1fccdaa0d..4a1487f4eaa 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/IconIndicator.qml @@ -68,7 +68,7 @@ Rectangle { states: [ State { name: "default" - when: !toolTipArea.containsMouse + when: !toolTipArea.containsMouse && root.enabled PropertyChanges { target: indicatorIcon color: StudioTheme.Values.themeLinkIndicatorColor @@ -76,11 +76,19 @@ Rectangle { }, State { name: "hover" - when: toolTipArea.containsMouse + when: toolTipArea.containsMouse && root.enabled PropertyChanges { target: indicatorIcon color: StudioTheme.Values.themeLinkIndicatorColorHover } + }, + State { + name: "disable" + when: !root.enabled + PropertyChanges { + target: indicatorIcon + color: StudioTheme.Values.themeLinkIndicatorColorDisabled + } } ] } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImagePreviewTooltipArea.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImagePreviewTooltipArea.qml index 0f2f5b69b9e..f8331acd4da 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImagePreviewTooltipArea.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ImagePreviewTooltipArea.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,9 +23,9 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 import HelperWidgets 2.0 -import QtQuick.Layouts 1.0 MouseArea { id: mouseArea @@ -35,7 +35,7 @@ MouseArea { onExited: tooltipBackend.hideTooltip() onCanceled: tooltipBackend.hideTooltip() onPositionChanged: tooltipBackend.reposition() - onClicked: { + onClicked: function(mouse) { forceActiveFocus() if (mouse.button === Qt.RightButton) showContextMenu() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml index b55a276d5b5..aa8eaa74456 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Quick 3D. @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick 2.15 import HelperWidgets 2.0 as HelperWidgets HelperWidgets.ComboBox { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml index aa7ba8c97db..4e2b1a2c1af 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml @@ -138,7 +138,7 @@ StudioControls.TextField { var textValue = lineEdit.text lineEdit.backendValue.value = textValue } - colorLogic.evaluate(); + colorLogic.evaluate() } property variant backendValueValueInternal: backendValue === undefined ? 0 : backendValue.value @@ -157,13 +157,13 @@ StudioControls.TextField { } function escapeString(string) { - var str = string; - str = str.replace(/\\/g, "\\\\"); - str.replace(/\"/g, "\\\""); - str = str.replace(/\t/g, "\\t"); - str = str.replace(/\r/g, "\\r"); - str = str.replace(/\n/g, '\\n'); - return str; + var str = string + str = str.replace(/\\/g, "\\\\") + str.replace(/\"/g, "\\\"") + str = str.replace(/\t/g, "\\t") + str = str.replace(/\r/g, "\\r") + str = str.replace(/\n/g, '\\n') + return str } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ListViewComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ListViewComboBox.qml index d1daa7baf8a..c79b6e01500 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ListViewComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ListViewComboBox.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Quick 3D. @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick 2.15 import HelperWidgets 2.0 as HelperWidgets import StudioControls 1.0 as StudioControls diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml index 68d0c225cd9..cf1fea7d07b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml @@ -108,9 +108,8 @@ Item { onPressed: calculateValue() onReleased: root.clicked() onPositionChanged: { - if (pressed) { + if (pressed) calculateValue() - } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginControl.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginControl.qml index 7929d2a0538..4cb33e4b3c2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginControl.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginControl.qml @@ -34,7 +34,7 @@ Row { property alias origin: myButton.origin property variant backendValue - onOriginSelectorClicked: { + onOriginSelectorClicked: function(value) { if (root.enabled) root.backendValue.setEnumeration("Item", value) } @@ -78,7 +78,7 @@ Row { property string origin: "Center" // This property is used to indicate the global hover state - property bool hover: myButton.hovered + property bool hover: myButton.hovered && root.enabled property alias backgroundVisible: buttonBackground.visible property alias backgroundRadius: buttonBackground.radius @@ -162,10 +162,8 @@ Row { border.width: StudioTheme.Values.border } - enter: Transition { - } - exit: Transition { - } + enter: Transition {} + exit: Transition {} } states: [ @@ -185,6 +183,7 @@ Row { State { name: "globalHover" when: actionIndicator.hover && !myButton.pressed && !originPopup.opened + && root.enabled PropertyChanges { target: buttonBackground color: StudioTheme.Values.themeControlBackgroundGlobalHover @@ -194,7 +193,7 @@ Row { State { name: "hover" when: myButton.hover && !actionIndicator.hover && !myButton.pressed - && !originPopup.opened + && !originPopup.opened && root.enabled PropertyChanges { target: buttonBackground color: StudioTheme.Values.themeControlBackgroundHover diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginSelector.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginSelector.qml index e42aff045b4..4511d7291f5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginSelector.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OriginSelector.qml @@ -42,7 +42,7 @@ Rectangle { id: mouseArea anchors.fill: parent hoverEnabled: true - onClicked: myControl.originSelectorClicked(value) + onClicked: myControl.originSelectorClicked(root.value) } states: [ diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/RoundedPanel.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/RoundedPanel.qml index f3b34c9e8b0..3a80e7a9a2d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/RoundedPanel.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/RoundedPanel.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.1 -import QtQuick.Layouts 1.0 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 import QtQuickDesignerTheme 1.0 import StudioTheme 1.0 as StudioTheme diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ScrollView.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ScrollView.qml index 7ddc82ebd5f..f3d9964dacc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ScrollView.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ScrollView.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml index 25216142e75..da0506f80e6 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml @@ -69,7 +69,7 @@ Item { height: StudioTheme.Values.sectionHeadHeight anchors.left: parent.left anchors.right: parent.right - color: Qt.lighter(StudioTheme.Values.themeSectionHeadBackground, 1.0 + (0.2 * level)) + color: Qt.lighter(StudioTheme.Values.themeSectionHeadBackground, 1.0 + (0.2 * section.level)) Image { id: arrow @@ -77,7 +77,7 @@ Item { height: 4 source: "image://icons/down-arrow" anchors.left: parent.left - anchors.leftMargin: 4 + (level * levelShift) + anchors.leftMargin: 4 + (section.level * section.levelShift) anchors.verticalCenter: parent.verticalCenter } @@ -85,7 +85,7 @@ Item { id: label anchors.verticalCenter: parent.verticalCenter color: StudioTheme.Values.themeTextColor - x: 22 + (level * levelShift) + x: 22 + (section.level * section.levelShift) font.pixelSize: StudioTheme.Values.myFontSize font.capitalization: Font.AllUppercase } @@ -94,7 +94,7 @@ Item { id: mouseArea anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { + onClicked: function(mouse) { if (mouse.button === Qt.LeftButton) { trans.enabled = true if (expandOnClick) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Spacer.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Spacer.qml index 21f84a86fce..f4f694ea28c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Spacer.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Spacer.qml @@ -23,8 +23,8 @@ ** ****************************************************************************/ -import QtQuick 2.12 -import QtQuick.Layouts 1.12 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 Item { height: 4 diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ToolTipArea.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ToolTipArea.qml index d89ec297477..abf18d0a377 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ToolTipArea.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ToolTipArea.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -23,16 +23,14 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.15 +import QtQuick.Layouts 1.15 import HelperWidgets 2.0 -import QtQuick.Layouts 1.0 MouseArea { id: mouseArea - Tooltip { - id: myTooltip - } + Tooltip { id: myTooltip } onExited: myTooltip.hideText() onCanceled: myTooltip.hideText() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml index b7bc955873f..919b337670b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml @@ -24,12 +24,12 @@ ****************************************************************************/ import QtQuick 2.15 +import QtQuick.Layouts 1.15 +import QtQuick.Controls 2.15 import HelperWidgets 2.0 import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme import QtQuickDesignerTheme 1.0 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 2.5 Row { id: urlChooser diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml index 1a60dac1cd7..8be58b7904a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml @@ -52,7 +52,7 @@ T.AbstractButton { activeFocusOnTab: false onHoveredChanged: { - if (parent !== undefined && parent.hoverCallback !== undefined) + if (parent !== undefined && parent.hoverCallback !== undefined && myButton.enabled) parent.hoverCallback() } @@ -132,7 +132,7 @@ T.AbstractButton { }, State { name: "globalHover" - when: myButton.globalHover && !myButton.hovered && !myButton.pressed + when: myButton.globalHover && !myButton.hovered && !myButton.pressed && myButton.enabled PropertyChanges { target: buttonBackground color: StudioTheme.Values.themeControlBackgroundGlobalHover @@ -140,7 +140,7 @@ T.AbstractButton { }, State { name: "hover" - when: myButton.hovered && !myButton.pressed + when: myButton.hovered && !myButton.pressed && myButton.enabled PropertyChanges { target: buttonBackground color: StudioTheme.Values.themeControlBackgroundHover diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml index 71fc2ec9016..77f43cb6975 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml @@ -31,7 +31,7 @@ import StudioTheme 1.0 as StudioTheme Row { id: myButtonRow - property bool hover: actionIndicator.hover || myButtonRow.childHover + property bool hover: (actionIndicator.hover || myButtonRow.childHover) && myButtonRow.enabled property bool childHover: false property alias actionIndicator: actionIndicator diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml index bc5f23f905b..e94098dbf94 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckBox.qml @@ -33,7 +33,7 @@ T.CheckBox { property alias actionIndicator: actionIndicator // This property is used to indicate the global hover state - property bool hover: myCheckBox.hovered + property bool hover: myCheckBox.hovered && myCheckBox.enabled property bool edit: false property alias actionIndicatorVisible: actionIndicator.visible diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckIndicator.qml index 57dbc5e8f4f..8083c3d376e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/CheckIndicator.qml @@ -33,7 +33,7 @@ Rectangle { property T.Control myControl property T.Popup myPopup - property bool hover: checkIndicatorMouseArea.containsMouse + property bool hover: checkIndicatorMouseArea.containsMouse && checkIndicator.enabled property bool pressed: checkIndicatorMouseArea.containsPress property bool checked: false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml index 071772d0f1b..982023636b7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml @@ -35,7 +35,8 @@ T.ComboBox { property alias labelColor: comboBoxInput.color // This property is used to indicate the global hover state - property bool hover: comboBoxInput.hover || actionIndicator.hover || popupIndicator.hover + property bool hover: (comboBoxInput.hover || actionIndicator.hover || popupIndicator.hover) + && myComboBox.enabled property bool edit: myComboBox.activeFocus && myComboBox.editable property bool open: comboBoxPopup.opened @@ -217,10 +218,8 @@ T.ComboBox { border.width: 0 } - enter: Transition { - } - exit: Transition { - } + enter: Transition {} + exit: Transition {} } states: [ @@ -307,7 +306,7 @@ T.ComboBox { } ] - Keys.onPressed: { + Keys.onPressed: function(event) { if (event.key === Qt.Key_Escape) myComboBox.focus = false } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml index ae995e6dbcd..663e7993f1e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBoxInput.qml @@ -33,7 +33,7 @@ TextInput { property T.Control myControl property bool edit: textInput.activeFocus - property bool hover: mouseArea.containsMouse + property bool hover: mouseArea.containsMouse && textInput.enabled z: 2 font: myControl.font @@ -91,7 +91,7 @@ TextInput { propagateComposedEvents: true acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor - onPressed: mouse.accepted = false + onPressed: function(mouse) { mouse.accepted = false } } states: [ diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml index 9f11b0d972c..3d430420add 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBox.qml @@ -51,7 +51,7 @@ T.SpinBox { property bool edit: spinBoxInput.activeFocus // This property is used to indicate the global hover state - property bool hover: mySpinBox.hovered || actionIndicator.hover + property bool hover: (mySpinBox.hovered || actionIndicator.hover) && mySpinBox.enabled property bool drag: false property bool sliderDrag: sliderPopup.drag @@ -199,10 +199,8 @@ T.SpinBox { width: mySpinBox.width - actionIndicator.width - (StudioTheme.Values.border * 2) height: StudioTheme.Values.sliderHeight - enter: Transition { - } - exit: Transition { - } + enter: Transition {} + exit: Transition {} } textFromValue: function (value, locale) { @@ -304,7 +302,7 @@ T.SpinBox { spinBoxInput.selectAll() } - Keys.onPressed: { + Keys.onPressed: function(event) { if (event.key === Qt.Key_Up || event.key === Qt.Key_Down) { event.accepted = true diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml index a721b8271ae..9ca34c16802 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxIndicator.qml @@ -32,7 +32,7 @@ Rectangle { property T.Control myControl - property bool hover: spinBoxIndicatorMouseArea.containsMouse + property bool hover: spinBoxIndicatorMouseArea.containsMouse && spinBoxIndicator.enabled property bool pressed: spinBoxIndicatorMouseArea.containsPress property bool released: false property bool realEnabled: true @@ -79,7 +79,7 @@ Rectangle { anchors.fill: parent hoverEnabled: true pressAndHoldInterval: 500 - onPressed: { + onPressed: function(mouse) { if (myControl.activeFocus) spinBoxIndicator.forceActiveFocus() @@ -90,7 +90,7 @@ Rectangle { pressAndHoldTimer.restart() pressedAndHeld = true } - onReleased: { + onReleased: function(mouse) { // Only trigger real released when pressAndHold isn't active if (!pressAndHoldTimer.running && containsMouse) spinBoxIndicator.realReleased() @@ -222,7 +222,7 @@ Rectangle { } PropertyChanges { target: spinBoxIndicator - color: "#2aafd3" // TODO + color: StudioTheme.Values.themeInteraction } }, State { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml index a47f1f708a7..8d92d9c94af 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml @@ -34,7 +34,7 @@ TextInput { property bool edit: textInput.activeFocus property bool drag: false - property bool hover: mouseArea.containsMouse + property bool hover: mouseArea.containsMouse && textInput.enabled z: 2 font: myControl.font @@ -57,7 +57,7 @@ TextInput { // TextInput focus needs to be set to activeFocus whenever it changes, // otherwise TextInput will get activeFocus whenever the parent SpinBox gets // activeFocus. This will lead to weird side effects. - onActiveFocusChanged: textInput.focus = activeFocus + onActiveFocusChanged: textInput.focus = textInput.activeFocus Rectangle { id: textInputBackground @@ -72,7 +72,7 @@ TextInput { Item { id: dragModifierWorkaround - Keys.onPressed: { + Keys.onPressed: function(event) { event.accepted = true if (event.modifiers & Qt.ControlModifier) { @@ -85,7 +85,7 @@ TextInput { mouseArea.calcValue(myControl.realValueModified) } } - Keys.onReleased: { + Keys.onReleased: function(event) { event.accepted = true mouseArea.stepSize = myControl.realStepSize mouseArea.calcValue(myControl.realValueModified) @@ -93,7 +93,7 @@ TextInput { } // Ensure that we get Up and Down key press events first - Keys.onShortcutOverride: { + Keys.onShortcutOverride: function(event) { event.accepted = (event.key === Qt.Key_Up || event.key === Qt.Key_Down) } @@ -119,7 +119,7 @@ TextInput { acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor - onPositionChanged: { + onPositionChanged: function(mouse) { if (!mouseArea.dragging && !myControl.edit && Math.abs(mouseArea.pressStartX - mouse.x) > StudioTheme.Values.dragThreshold @@ -149,7 +149,7 @@ TextInput { onCanceled: mouseArea.endDrag() - onClicked: { + onClicked: function(mouse) { if (textInput.edit) mouse.accepted = false @@ -162,7 +162,7 @@ TextInput { textInput.deselect() // QTBUG-75862 } - onPressed: { + onPressed: function(mouse) { if (textInput.edit) mouse.accepted = false @@ -170,7 +170,7 @@ TextInput { mouseArea.pressStartX = mouseArea.mouseX } - onReleased: { + onReleased: function(mouse) { if (textInput.edit) mouse.accepted = false @@ -213,7 +213,7 @@ TextInput { callback() } - onWheel: { + onWheel: function(wheel) { if (!myControl.__wheelEnabled) return diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Section.qml index 2178baddf69..23ee5615700 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Section.qml @@ -33,20 +33,16 @@ Item { property int leftPadding: 8 property int topPadding: 4 property int rightPadding: 0 - property int animationDuration: 120 - property bool expanded: true clip: true Rectangle { id: header - height: StudioTheme.Values.sectionHeadHeight - anchors.left: parent.left anchors.right: parent.right - + height: StudioTheme.Values.sectionHeadHeight color: StudioTheme.Values.themeSectionHeadBackground SectionLabel { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Slider.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Slider.qml index ddb6c165c61..dde7dcebff1 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Slider.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Slider.qml @@ -217,8 +217,8 @@ T.Slider { acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor // Sets the global hover - onContainsMouseChanged: slider.hover = containsMouse - onPressed: mouse.accepted = false + onContainsMouseChanged: slider.hover = mouseArea.containsMouse + onPressed: function(mouse) { mouse.accepted = false } } states: [ diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml index 98f20c303a5..4c32353697c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBox.qml @@ -41,7 +41,7 @@ T.SpinBox { property bool edit: spinBoxInput.activeFocus // This property is used to indicate the global hover state - property bool hover: mySpinBox.hovered || actionIndicator.hover + property bool hover: (mySpinBox.hovered || actionIndicator.hover) && mySpinBox.enabled property bool drag: false property bool sliderDrag: sliderPopup.drag @@ -164,10 +164,8 @@ T.SpinBox { width: mySpinBox.width - actionIndicator.width - (StudioTheme.Values.border * 2) height: StudioTheme.Values.sliderHeight - enter: Transition { - } - exit: Transition { - } + enter: Transition {} + exit: Transition {} } textFromValue: function (value, locale) { @@ -256,7 +254,7 @@ T.SpinBox { sliderPopup.close() } - Keys.onPressed: { + Keys.onPressed: function(event) { if (event.key === Qt.Key_Up || event.key === Qt.Key_Down) { event.accepted = true diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxIndicator.qml index 17d7ac7eb34..7bb78311a6c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxIndicator.qml @@ -32,7 +32,7 @@ Rectangle { property T.Control myControl - property bool hover: spinBoxIndicatorMouseArea.containsMouse + property bool hover: spinBoxIndicatorMouseArea.containsMouse && spinBoxIndicator.enabled property bool pressed: spinBoxIndicatorMouseArea.containsPress property alias iconFlip: spinBoxIndicatorIconScale.yScale @@ -46,7 +46,7 @@ Rectangle { id: spinBoxIndicatorMouseArea anchors.fill: parent hoverEnabled: true - onPressed: { + onPressed: function(mouse) { if (myControl.activeFocus) spinBoxIndicator.forceActiveFocus() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml index 4d0432d3f38..855cc220fa5 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/SpinBoxInput.qml @@ -34,7 +34,7 @@ TextInput { property bool edit: textInput.activeFocus property bool drag: false - property bool hover: mouseArea.containsMouse + property bool hover: mouseArea.containsMouse && textInput.enabled z: 2 font: myControl.font @@ -57,7 +57,7 @@ TextInput { // TextInput focus needs to be set to activeFocus whenever it changes, // otherwise TextInput will get activeFocus whenever the parent SpinBox gets // activeFocus. This will lead to weird side effects. - onActiveFocusChanged: textInput.focus = activeFocus + onActiveFocusChanged: textInput.focus = textInput.activeFocus Rectangle { id: textInputBackground @@ -115,8 +115,8 @@ TextInput { propagateComposedEvents: true acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor - onPressed: mouse.accepted = false - onWheel: { + onPressed: function(mouse) { mouse.accepted = false } + onWheel: function(wheel) { if (!myControl.__wheelEnabled) return diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextArea.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextArea.qml index 62881454189..677e8b60539 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextArea.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextArea.qml @@ -127,7 +127,7 @@ TextField { myTextField.text = txtStorage.slice(0, sliceAt).padEnd(sliceAt + 3, '.') } - Keys.onPressed: { + Keys.onPressed: function(event) { if (event.key === Qt.Key_Escape) popup.opened ? popup.close() : myTextField.focus = false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml index 17fbe899c42..ea58bd71958 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml @@ -34,8 +34,8 @@ T.TextField { property alias translationIndicator: translationIndicator // This property is used to indicate the global hover state - property bool hover: actionIndicator.hover || mouseArea.containsMouse - || translationIndicator.hover + property bool hover: (actionIndicator.hover || mouseArea.containsMouse + || translationIndicator.hover) && myTextField.enabled property bool edit: myTextField.activeFocus property alias actionIndicatorVisible: actionIndicator.visible @@ -75,7 +75,7 @@ T.TextField { propagateComposedEvents: true acceptedButtons: Qt.LeftButton | Qt.RightButton cursorShape: Qt.PointingHandCursor - onPressed: { + onPressed: function(mouse) { if (mouse.button === Qt.RightButton) contextMenu.popup(myTextField) @@ -147,6 +147,7 @@ T.TextField { State { name: "globalHover" when: (actionIndicator.hover || translationIndicator.hover) && !myTextField.edit + && myTextField.enabled PropertyChanges { target: textFieldBackground color: StudioTheme.Values.themeControlBackgroundGlobalHover @@ -160,7 +161,7 @@ T.TextField { State { name: "hover" when: mouseArea.containsMouse && !actionIndicator.hover && !translationIndicator.hover - && !myTextField.edit + && !myTextField.edit && myTextField.enabled PropertyChanges { target: textFieldBackground color: StudioTheme.Values.themeControlBackgroundHover @@ -203,7 +204,7 @@ T.TextField { } ] - Keys.onPressed: { + Keys.onPressed: function(event) { if (event.key === Qt.Key_Escape) myTextField.focus = false } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml index 2d7ca74f16c..3b56d0a9807 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml @@ -32,7 +32,7 @@ Item { property Item myControl - property bool hover: translationIndicatorMouseArea.containsMouse + property bool hover: translationIndicatorMouseArea.containsMouse && translationIndicator.enabled property bool pressed: translationIndicatorMouseArea.pressed property bool checked: false @@ -62,7 +62,7 @@ Item { id: translationIndicatorMouseArea anchors.fill: parent hoverEnabled: true - onPressed: mouse.accepted = true // TODO + onPressed: function(mouse) { mouse.accepted = true } onClicked: { translationIndicator.checked = !translationIndicator.checked translationIndicator.clicked()