2020-06-17 19:31:01 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-05-19 13:22:38 +00:00
|
|
|
import QtQml 2.14
|
2020-05-29 18:02:06 +00:00
|
|
|
import "../imports"
|
2020-05-19 13:22:38 +00:00
|
|
|
|
|
|
|
Button {
|
2020-05-29 18:02:06 +00:00
|
|
|
property string label: "My button"
|
2020-07-13 18:45:54 +00:00
|
|
|
property color btnColor: Style.current.secondaryBackground
|
2020-06-11 08:22:20 +00:00
|
|
|
property color btnBorderColor: "transparent"
|
|
|
|
property int btnBorderWidth: 0
|
2020-07-02 15:14:31 +00:00
|
|
|
property color textColor: Style.current.blue
|
2020-08-14 19:19:08 +00:00
|
|
|
property int textSize: 15
|
2020-05-29 18:12:57 +00:00
|
|
|
property bool disabled: false
|
2020-05-19 13:22:38 +00:00
|
|
|
|
|
|
|
id: btnStyled
|
2020-07-02 15:14:31 +00:00
|
|
|
width: txtBtnLabel.width + 2 * Style.current.padding
|
2020-05-29 18:02:06 +00:00
|
|
|
height: 44
|
2020-05-29 18:12:57 +00:00
|
|
|
enabled: !disabled
|
2020-05-19 13:22:38 +00:00
|
|
|
|
|
|
|
background: Rectangle {
|
2020-08-14 19:19:08 +00:00
|
|
|
color: disabled ? Style.current.grey :
|
|
|
|
hovered ? Qt.darker(btnStyled.btnColor, 1.1) : btnStyled.btnColor
|
2020-07-02 15:14:31 +00:00
|
|
|
radius: Style.current.radius
|
2020-05-29 18:02:06 +00:00
|
|
|
anchors.fill: parent
|
2020-06-11 08:22:20 +00:00
|
|
|
border.color: btnBorderColor
|
|
|
|
border.width: btnBorderWidth
|
2020-05-19 13:22:38 +00:00
|
|
|
}
|
|
|
|
|
2020-06-19 18:06:58 +00:00
|
|
|
StyledText {
|
2020-05-19 13:22:38 +00:00
|
|
|
id: txtBtnLabel
|
2020-07-02 15:14:31 +00:00
|
|
|
color: btnStyled.disabled ? Style.current.darkGrey : btnStyled.textColor
|
2020-08-14 19:19:08 +00:00
|
|
|
font.pixelSize: btnStyled.textSize
|
2020-05-19 13:22:38 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-05-29 18:12:57 +00:00
|
|
|
text: btnStyled.label
|
2020-05-29 18:02:06 +00:00
|
|
|
font.weight: Font.Medium
|
2020-05-19 13:22:38 +00:00
|
|
|
}
|
2020-06-25 13:23:17 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
parent.onClicked()
|
|
|
|
}
|
|
|
|
}
|
2020-05-19 13:22:38 +00:00
|
|
|
}
|