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.

50 lines
857 B

10 years ago
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.0
import QtQuick.Controls.Styles 1.1
Rectangle {
id: buttonActionContainer
10 years ago
property string disableStateImg
property string enabledStateImg
property string buttonTooltip
10 years ago
property string buttonShortcut
10 years ago
signal clicked
10 years ago
function enabled(state)
{
buttonAction.enabled = state;
if (state)
10 years ago
debugImage.source = enabledStateImg;
10 years ago
else
10 years ago
debugImage.source = disableStateImg;
10 years ago
}
Button
10 years ago
{
10 years ago
anchors.fill: parent
id: debugImg
10 years ago
/* iconSource: enabledStateImg
*/ action: buttonAction
}
Image {
id: debugImage
source: enabledStateImg
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
width: 15
height: 15
}
Action {
tooltip: buttonTooltip
id: buttonAction
10 years ago
shortcut: buttonShortcut
onTriggered: {
buttonActionContainer.clicked();
}
}
10 years ago
}