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 <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2019-07-25 15:16:40 +02:00
committed by Henning Gründl
parent a968789324
commit ef95a19a5f
3 changed files with 6 additions and 27 deletions

View File

@@ -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

View File

@@ -25,7 +25,6 @@
import QtQuick 2.1
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0 as Controls
Image {
id: root

View File

@@ -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)