From ef95a19a5f0f76dd0e2a5b7cb198fbff17a9bf57 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Thu, 25 Jul 2019 15:16:40 +0200 Subject: [PATCH] QmlDesigner: Update GradientDialogPopup Controls 2 * Add background radius property to AbstractButton * Use AbstractButton instead of Controls 1 Button for GradientDialogPopup * Remove a few unnecessary imports Change-Id: I02e0c5f198bd701d144effc5a574fc247182ffb4 Reviewed-by: Thomas Hartmann --- .../HelperWidgets/GradientDialogPopup.qml | 31 +++---------------- .../HelperWidgets/GradientPopupIndicator.qml | 1 - .../imports/StudioControls/AbstractButton.qml | 1 + 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml index bbfc5525c7f..a3e886f6b57 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml @@ -25,9 +25,9 @@ import QtQuick 2.1 import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 as Controls +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme import QtQuickDesignerTheme 1.0 -import QtQuick.Controls.Styles 1.1 Loader { id: gradientDialogLoader @@ -93,33 +93,12 @@ Loader { text: qsTr("Gradient Properties") } - Button { + StudioControls.AbstractButton { width: 16 height: 16 - style: ButtonStyle { - background: Item { - Image { - width: 16 - height: 16 - source: "image://icons/error" - opacity: { - if (control.pressed) - return 0.8 - return 1.0 - } - Rectangle { - z: -1 - anchors.fill: parent - color: control.pressed - || control.hovered ? Theme.qmlDesignerBackgroundColorDarker() : Theme.qmlDesignerButtonColor() - border.color: Theme.qmlDesignerBorderColor() - radius: 2 - } - } - } - } + buttonIcon: StudioTheme.Constants.closeCross onClicked: gradientDialogLoader.visible = false - + backgroundRadius: 2 anchors.right: parent.right anchors.top: parent.top anchors.margins: 4 diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml index f39486c78fa..1f617e44377 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPopupIndicator.qml @@ -25,7 +25,6 @@ import QtQuick 2.1 import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 as Controls Image { id: root diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml index 4dec58d4b6c..222334f7cae 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml @@ -33,6 +33,7 @@ T.AbstractButton { property alias buttonIcon: buttonIcon.text property alias iconColor: buttonIcon.color property alias backgroundVisible: buttonBackground.visible + property alias backgroundRadius: buttonBackground.radius implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)