forked from qt-creator/qt-creator
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:
committed by
Henning Gründl
parent
a968789324
commit
ef95a19a5f
@@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Layouts 1.0
|
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 QtQuickDesignerTheme 1.0
|
||||||
import QtQuick.Controls.Styles 1.1
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: gradientDialogLoader
|
id: gradientDialogLoader
|
||||||
@@ -93,33 +93,12 @@ Loader {
|
|||||||
text: qsTr("Gradient Properties")
|
text: qsTr("Gradient Properties")
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
StudioControls.AbstractButton {
|
||||||
width: 16
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
style: ButtonStyle {
|
buttonIcon: StudioTheme.Constants.closeCross
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: gradientDialogLoader.visible = false
|
onClicked: gradientDialogLoader.visible = false
|
||||||
|
backgroundRadius: 2
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.margins: 4
|
anchors.margins: 4
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Layouts 1.0
|
import QtQuick.Layouts 1.0
|
||||||
import QtQuick.Controls 1.0 as Controls
|
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: root
|
id: root
|
||||||
|
@@ -33,6 +33,7 @@ T.AbstractButton {
|
|||||||
property alias buttonIcon: buttonIcon.text
|
property alias buttonIcon: buttonIcon.text
|
||||||
property alias iconColor: buttonIcon.color
|
property alias iconColor: buttonIcon.color
|
||||||
property alias backgroundVisible: buttonBackground.visible
|
property alias backgroundVisible: buttonBackground.visible
|
||||||
|
property alias backgroundRadius: buttonBackground.radius
|
||||||
|
|
||||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||||
implicitContentWidth + leftPadding + rightPadding)
|
implicitContentWidth + leftPadding + rightPadding)
|
||||||
|
Reference in New Issue
Block a user