mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 08:34:34 +02:00
45 lines
1.1 KiB
QML
45 lines
1.1 KiB
QML
import QtQuick 1.1
|
|
|
|
Rectangle {
|
|
id: root
|
|
height: contentRow.height + defaultFontHeight / 2
|
|
width: contentRow.width + defaultFontHeight / 2
|
|
|
|
property alias text: buttonText.text
|
|
property alias imageSource: image.source
|
|
property bool enabled: true
|
|
|
|
color: "transparent"
|
|
border.width: defaultFontHeight / 16
|
|
border.color: buttonMouseArea.containsMouse ? "lightblue" : "transparent"
|
|
radius: defaultFontHeight / 4
|
|
|
|
signal clicked()
|
|
|
|
Row {
|
|
id: contentRow
|
|
spacing: defaultFontHeight / 4
|
|
width: childrenRect.width
|
|
height: childrenRect.height
|
|
anchors.centerIn: parent
|
|
Image {
|
|
id: image
|
|
height: defaultFontHeight
|
|
width: source.length == 0 ? 0 : height
|
|
}
|
|
|
|
Text {
|
|
id: buttonText
|
|
color: root.enabled ? "black" : "grey"
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
id: buttonMouseArea
|
|
anchors.fill: parent
|
|
hoverEnabled: root.enabled
|
|
enabled: root.enabled
|
|
onClicked: root.clicked();
|
|
}
|
|
}
|