2020-01-16 16:30:39 +01:00
|
|
|
import QtQuick 2.10
|
|
|
|
|
import QtQuick.Templates 2.1 as T
|
|
|
|
|
import loginui2 1.0
|
|
|
|
|
|
|
|
|
|
T.Button {
|
|
|
|
|
id: control
|
|
|
|
|
|
|
|
|
|
font: Constants.font
|
|
|
|
|
implicitWidth: Math.max(
|
|
|
|
|
background ? background.implicitWidth : 0,
|
|
|
|
|
contentItem.implicitWidth + leftPadding + rightPadding)
|
|
|
|
|
implicitHeight: Math.max(
|
|
|
|
|
background ? background.implicitHeight : 0,
|
|
|
|
|
contentItem.implicitHeight + topPadding + bottomPadding)
|
|
|
|
|
leftPadding: 4
|
|
|
|
|
rightPadding: 4
|
|
|
|
|
|
2020-07-02 18:06:43 +02:00
|
|
|
text: "My Button"
|
|
|
|
|
|
|
|
|
|
background: buttonBackground
|
|
|
|
|
Rectangle {
|
2020-01-16 16:30:39 +01:00
|
|
|
id: buttonBackground
|
|
|
|
|
color: "#41cd52"
|
|
|
|
|
implicitWidth: 100
|
|
|
|
|
implicitHeight: 40
|
|
|
|
|
opacity: enabled ? 1 : 0.3
|
2020-07-02 18:06:43 +02:00
|
|
|
border.color: "gray"
|
2020-01-16 16:30:39 +01:00
|
|
|
border.width: 1
|
2020-07-02 18:06:43 +02:00
|
|
|
radius: 2
|
2020-01-16 16:30:39 +01:00
|
|
|
}
|
|
|
|
|
|
2020-07-02 18:06:43 +02:00
|
|
|
contentItem: textItem
|
|
|
|
|
Text {
|
2020-01-16 16:30:39 +01:00
|
|
|
id: textItem
|
|
|
|
|
text: control.text
|
|
|
|
|
|
|
|
|
|
opacity: enabled ? 1.0 : 0.3
|
2020-07-02 18:06:43 +02:00
|
|
|
color: "#fdfdfd"
|
2020-01-16 16:30:39 +01:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
elide: Text.ElideRight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
states: [
|
|
|
|
|
State {
|
|
|
|
|
name: "normal"
|
|
|
|
|
when: !control.down
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: buttonBackground
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "down"
|
|
|
|
|
when: control.down
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: textItem
|
2020-07-02 18:06:43 +02:00
|
|
|
color: "#fdfdfd"
|
2020-01-16 16:30:39 +01:00
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: buttonBackground
|
2020-07-02 18:06:43 +02:00
|
|
|
color: "#21be2b"
|
2020-01-16 16:30:39 +01:00
|
|
|
border.color: "black"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-02 18:06:43 +02:00
|
|
|
/*##^##
|
|
|
|
|
Designer {
|
|
|
|
|
D{i:0;autoSize:true;height:480;width:640}
|
|
|
|
|
}
|
|
|
|
|
##^##*/
|