From 80ff1f90fdb15c74b36335a3398039808a2c287a Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 4 Sep 2024 13:50:49 +0200 Subject: [PATCH] QmlDesigner: Remove wrong font family alias * Remove wrong font family alias from AbstractButton and replace it with the correct one * Change the Contants font to the system/application font * Change warning color in PropertyEditor Change-Id: I1a33ced8ffc34aafa78f75100b2531845ddff5ef Reviewed-by: Thomas Hartmann --- .../ConnectionsDialogForm.qml | 8 ++++---- .../newprojectdialog/NewProjectDialog.qml | 4 ++-- .../imports/NewProjectDialog/Details.qml | 5 +++-- .../QtQuick/AlignDistributeSection.qml | 7 +++---- .../QtQuick/EffectsSection.qml | 4 ++-- .../imports/HelperWidgets/ComponentButton.qml | 2 +- .../imports/HelperWidgets/ComponentSection.qml | 2 +- .../HelperWidgets/DynamicPropertiesSection.qml | 2 +- .../imports/StudioControls/AbstractButton.qml | 12 ++++++++---- .../imports/StudioTheme/InternalConstants.qml | 18 +++++++++--------- .../stateseditor/StateThumbnail.qml | 2 +- share/qtcreator/qmldesigner/toolbar/Main.qml | 6 +++--- 12 files changed, 38 insertions(+), 34 deletions(-) diff --git a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml index a799165375f..5ca4ed28d25 100644 --- a/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml +++ b/share/qtcreator/qmldesigner/connectionseditor/ConnectionsDialogForm.qml @@ -120,7 +120,7 @@ Column { buttonIcon: qsTr("Add Condition") tooltip: qsTr("Sets a logical condition for the selected Signal. It works with the properties of the Target component.") iconSize: StudioTheme.Values.baseFontSize - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family anchors.horizontalCenter: parent.horizontalCenter visible: action.currentValue !== ConnectionModelStatementDelegate.Custom && !backend.hasCondition @@ -133,7 +133,7 @@ Column { buttonIcon: qsTr("Remove Condition") tooltip: qsTr("Removes the logical condition for the Target component.") iconSize: StudioTheme.Values.baseFontSize - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family anchors.horizontalCenter: parent.horizontalCenter visible: action.currentValue !== ConnectionModelStatementDelegate.Custom && backend.hasCondition @@ -184,7 +184,7 @@ Column { buttonIcon: qsTr("Add Else Statement") tooltip: qsTr("Sets an alternate condition for the previously defined logical condition.") iconSize: StudioTheme.Values.baseFontSize - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family anchors.horizontalCenter: parent.horizontalCenter visible: action.currentValue !== ConnectionModelStatementDelegate.Custom && backend.hasCondition && !backend.hasElse @@ -198,7 +198,7 @@ Column { buttonIcon: qsTr("Remove Else Statement") tooltip: qsTr("Removes the alternate logical condition for the previously defined logical condition.") iconSize: StudioTheme.Values.baseFontSize - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family anchors.horizontalCenter: parent.horizontalCenter visible: action.currentValue !== ConnectionModelStatementDelegate.Custom && backend.hasCondition && backend.hasElse diff --git a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml index ce298f7a2f8..bc3679a06cf 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml @@ -321,7 +321,7 @@ Item { visible: true buttonIcon: qsTr("Cancel") iconSize: DialogValues.defaultPixelSize - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family onClicked: { BackendApi.reject(); @@ -337,7 +337,7 @@ Item { buttonIcon: qsTr("Create") iconSize: DialogValues.defaultPixelSize enabled: BackendApi.fieldsValid - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family onClicked: { BackendApi.accept(); diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml index 75677cbffcc..f905191eff9 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml @@ -121,7 +121,7 @@ Item { iconSize: 20 visible: true buttonIcon: "…" - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family onClicked: { var newLocation = BackendApi.chooseProjectLocation() @@ -439,7 +439,8 @@ Item { id: savePresetButton width: StudioTheme.Values.singleControlColumnWidth buttonIcon: qsTr("Save Custom Preset") - iconFont: StudioTheme.Constants.font + iconSize: DialogValues.defaultPixelSize + iconFontFamily: StudioTheme.Constants.font.family anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AlignDistributeSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AlignDistributeSection.qml index 401c9c66af5..aa15697850d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AlignDistributeSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AlignDistributeSection.qml @@ -337,7 +337,6 @@ Section { PropertyLabel { text: qsTr("Warning") visible: root.warningVisible - font.weight: Font.Bold } SecondColumnLayout { @@ -354,7 +353,7 @@ Section { Layout.fillWidth: true font.family: StudioTheme.Constants.font.family font.pixelSize: StudioTheme.Values.myFontSize - color: StudioTheme.Values.themeTextColor + color: StudioTheme.Values.themeAmberLight wrapMode: Text.WordWrap text: qsTr("- The selection contains the root component.") } @@ -365,7 +364,7 @@ Section { Layout.fillWidth: true font.family: StudioTheme.Constants.font.family font.pixelSize: StudioTheme.Values.myFontSize - color: StudioTheme.Values.themeTextColor + color: StudioTheme.Values.themeAmberLight wrapMode: Text.WordWrap text: qsTr("- The selection contains a non-visual component.") } @@ -376,7 +375,7 @@ Section { Layout.fillWidth: true font.family: StudioTheme.Constants.font.family font.pixelSize: StudioTheme.Values.myFontSize - color: StudioTheme.Values.themeTextColor + color: StudioTheme.Values.themeAmberLight wrapMode: Text.WordWrap text: qsTr("- A component in the selection uses anchors.") } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml index 59111572806..e6bd6193c67 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/EffectsSection.qml @@ -62,7 +62,7 @@ Section { implicitWidth: StudioTheme.Values.singleControlColumnWidth width: StudioTheme.Values.singleControlColumnWidth buttonIcon: root.hasDesignerEffect ? qsTr("Remove Effects") : qsTr("Add Effects") - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family tooltip: qsTr("Adds visual effects on the component.") onClicked: { if (root.hasDesignerEffect) { @@ -535,7 +535,7 @@ Section { implicitWidth: StudioTheme.Values.singleControlColumnWidth width: StudioTheme.Values.singleControlColumnWidth buttonIcon: qsTr("Add Shadow Effect") - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family tooltip: qsTr("Adds Drop Shadow or Inner Shadow effects to a component.") onClicked: { modelNodeBackend.createModelNode(root.effectNode, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml index 12c003af638..e8bea7b0bee 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml @@ -28,7 +28,7 @@ Column { AbstractButton { implicitWidth: 180 buttonIcon: qsTr("Edit Component") - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family onClicked: goIntoComponent() } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml index a29bda0ba57..f3b460e0994 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml @@ -246,7 +246,7 @@ Section { width: StudioTheme.Values.singleControlColumnWidth visible: !annotationEditor.hasAuxData buttonIcon: qsTr("Add Annotation") - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family tooltip: qsTr("Adds a note with a title to explain the component.") onClicked: annotationEditor.showWidget() onHoveredChanged: annotationEditor.checkAux() diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml index 9ddec119153..dea81cab815 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/DynamicPropertiesSection.qml @@ -732,7 +732,7 @@ Section { id: acceptButton buttonIcon: qsTr("Add Property") - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family width: cePopup.width / 3 enabled: textField.acceptableInput diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml index 703591887aa..a8781707361 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml @@ -16,8 +16,10 @@ T.AbstractButton { property alias buttonIcon: buttonIcon.text property alias iconColor: buttonIcon.color - property alias iconFont: buttonIcon.font.family - property alias iconSize: buttonIcon.font.pixelSize + + property string iconFontFamily: StudioTheme.Constants.iconFont.family + property int iconSize: control.style.baseIconFontSize + property alias iconItalic: buttonIcon.font.italic property alias iconBold: buttonIcon.font.bold property alias iconRotation: buttonIcon.rotation @@ -58,8 +60,10 @@ T.AbstractButton { T.Label { id: buttonIcon color: control.style.icon.idle - font.family: StudioTheme.Constants.iconFont.family - font.pixelSize: control.style.baseIconFontSize + font { + family: control.iconFontFamily + pixelSize: control.iconSize + } verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter anchors.fill: parent diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml index 3eb90118374..e606d48b30f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml @@ -384,17 +384,17 @@ QtObject { readonly property string zoomSelection: "\u0193" readonly property font iconFont: Qt.font({ - "family": controlIcons.name, - "pixelSize": 12 - }) + family: controlIcons.name, + pixelSize: 12 + }) readonly property font font: Qt.font({ - "family": "Arial", - "pointSize": Qt.application.font.pixelSize - }) + family: Qt.application.font.family, + pointSize: Qt.application.font.pixelSize + }) readonly property font largeFont: Qt.font({ - "family": "Arial", - "pointSize": Qt.application.font.pixelSize * 1.6 - }) + family: "Arial", + pointSize: Qt.application.font.pixelSize * 1.6 + }) } diff --git a/share/qtcreator/qmldesigner/stateseditor/StateThumbnail.qml b/share/qtcreator/qmldesigner/stateseditor/StateThumbnail.qml index 703bc3e7ed0..ccbb5d3d0e6 100644 --- a/share/qtcreator/qmldesigner/stateseditor/StateThumbnail.qml +++ b/share/qtcreator/qmldesigner/stateseditor/StateThumbnail.qml @@ -168,7 +168,7 @@ Item { height: stateBackground.controlHeight checkedInverted: true buttonIcon: qsTr("Default") - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family tooltip: qsTr("Set State as default") onClicked: { root.defaultClicked() diff --git a/share/qtcreator/qmldesigner/toolbar/Main.qml b/share/qtcreator/qmldesigner/toolbar/Main.qml index 5cdc2f4d516..c69a0205e4c 100644 --- a/share/qtcreator/qmldesigner/toolbar/Main.qml +++ b/share/qtcreator/qmldesigner/toolbar/Main.qml @@ -153,7 +153,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter anchors.left: runProject.right anchors.leftMargin: 10 - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family buttonIcon: qsTr("Live Preview") onClicked: { @@ -340,7 +340,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter anchors.right: moreItems.left anchors.rightMargin: 8 - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family buttonIcon: qsTr("Share") visible: !root.flyoutEnabled && backend.isSharingEnabled enabled: backend.isSharingEnabled @@ -466,7 +466,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter style: StudioTheme.Values.primaryToolbarStyle width: shareButton.width - iconFont: StudioTheme.Constants.font + iconFontFamily: StudioTheme.Constants.font.family buttonIcon: qsTr("Share") enabled: backend.isSharingEnabled tooltip: shareButton.enabled ? qsTr("Share your project online.") : qsTr("Sharing your project online is disabled in the Community Version.")