You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
wow-app/components/StandardButton.qml

61 lines
1.5 KiB

10 years ago
import QtQuick 2.0
Item {
id: button
10 years ago
height: 37
10 years ago
property string shadowPressedColor
property string shadowReleasedColor
10 years ago
property string pressedColor
property string releasedColor
property string icon: ""
10 years ago
property string textColor: "#FFFFFF"
property int fontSize: 12
10 years ago
property alias text: label.text
signal clicked()
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: parent.height - 1
10 years ago
y: buttonArea.pressed ? 0 : 1
//radius: 4
10 years ago
color: buttonArea.pressed ? parent.shadowPressedColor : parent.shadowReleasedColor
10 years ago
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
height: parent.height - 1
10 years ago
y: buttonArea.pressed ? 1 : 0
10 years ago
color: buttonArea.pressed ? parent.pressedColor : parent.releasedColor
//radius: 4
10 years ago
}
Text {
id: label
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
10 years ago
font.family: "Arial"
font.bold: true
font.letterSpacing: -1
font.pixelSize: button.fontSize
10 years ago
color: parent.textColor
visible: parent.icon === ""
}
Image {
anchors.centerIn: parent
visible: parent.icon !== ""
source: parent.icon
10 years ago
}
MouseArea {
id: buttonArea
anchors.fill: parent
onClicked: parent.clicked()
}
}