From d5f1a49a7b090dec3c464dc3ab73b84a3321811c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 28 May 2025 16:34:36 +0200 Subject: [PATCH] Fix rectangle specifics in 4.7.2 Task-number: QDS-15460 Change-Id: Ie534be07c4093e10dcd3c4ab895ee63a1ff7d777 Reviewed-by: Thomas Hartmann --- .../QtQuick/RectangleSpecifics.qml | 3 - .../HelperWidgets/CornerRadiusSection.qml | 132 ++++++++++++++++++ .../imports/HelperWidgets/qmldir | 1 + 3 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CornerRadiusSection.qml diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml index 6afd94b72e0..39802ea2e25 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RectangleSpecifics.qml @@ -75,8 +75,6 @@ Column { } } } -<<<<<<< HEAD (08c2c6 QmlDesigner: Fix shape rendering in 2D view) -======= CornerRadiusSection { id: cornerRadiusSection @@ -87,5 +85,4 @@ Column { visible: majorQtQuickVersion >= 6 && minorQtQuickVersion >= 7 && cornerRadiusSection.radiiAvailable } ->>>>>>> CHANGE (80dbdf QmlDesigner: Fix corner radii for older QtQick) } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CornerRadiusSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CornerRadiusSection.qml new file mode 100644 index 00000000000..824881ce2b6 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CornerRadiusSection.qml @@ -0,0 +1,132 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +import QtQuick +import HelperWidgets +import StudioTheme as StudioTheme + +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Corner Radiuses") + + SectionLayout { + PropertyLabel { + text: qsTr("Top") + tooltip: qsTr("Toggles the top left or right corner to a rounded shape.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.topLeftRadius + decimals: 0 + minimumValue: 0 + maximumValue: 0xffff + stepSize: 1 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + MultiIconLabel { + icon0: StudioTheme.Constants.cornerA + icon1: StudioTheme.Constants.cornerB + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.topRightRadius + decimals: 0 + minimumValue: 0 + maximumValue: 0xffff + stepSize: 1 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + MultiIconLabel { + icon0: StudioTheme.Constants.cornerA + icon1: StudioTheme.Constants.cornerB + rotation: 90 + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Bottom") + tooltip: qsTr("Toggles the bottom left or right corner to a rounded shape.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.bottomLeftRadius + decimals: 0 + minimumValue: 0 + maximumValue: 0xffff + stepSize: 1 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + MultiIconLabel { + icon0: StudioTheme.Constants.cornerA + icon1: StudioTheme.Constants.cornerB + rotation: 270 + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.bottomRightRadius + decimals: 0 + minimumValue: 0 + maximumValue: 0xffff + stepSize: 1 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + MultiIconLabel { + icon0: StudioTheme.Constants.cornerA + icon1: StudioTheme.Constants.cornerB + rotation: 180 + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Global") + tooltip: qsTr("Toggles all the corners into a rounded shape.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.radius + decimals: 0 + minimumValue: 0 + maximumValue: 0xffff + stepSize: 1 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + IconLabel { + icon: StudioTheme.Constants.cornersAll + } + + ExpandingSpacer {} + } + } +} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir index 8429c162a15..e4e7377e377 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir @@ -68,3 +68,4 @@ TextInputSection 2.0 TextInputSection.qml ToolTipArea 2.0 ToolTipArea.qml UrlChooser 2.0 UrlChooser.qml VerticalScrollBar 2.0 VerticalScrollBar.qml +CornerRadiusSection 2.0 CornerRadiusSection.qml