/* * Copyright (C) 2013 by Neusoft * Author : zyhd * */ /** * A button with optional label and icon . */ import QtQuick 2.0 HMIMouseArea{ id: button width: buttonImg.width height: buttonImg.height /** * type:bool * This property holds if the label for the button will be displayed or not. */ property alias label: buttonLabel.visible /** * type:string * This property holds the text label for the button. */ property alias labelText: buttonLabel.text /** * type:color * This property holds the the color of text label for the button. */ property alias labelColor: buttonLabel.color /** * type:real * This property holds the font.pointsize of text label for the button. */ property alias labelSize: buttonLabel.font.pixelSize property alias labelPixelSize : buttonLabel.font.pixelSize /** * type:bool * This property holds whether the font weight of the text label for the button is bold. */ property alias labelBold: buttonLabel.font.bold /** * type:string * This property holds the source url for the Button's background image. * * The default value is an empty url, which displays no background image. */ property alias labelStyle: buttonLabel.font.family property string btnImg property string btnImgOnPressed property string btnImgOnDisabled property string btnImgOnCheck property string btnIcon property string btnIconOnPressed property string btnIconOnDisabled property alias btnWidth: buttonImg.width property alias btnHeight: buttonImg.height property int rotationAngle: 0 property alias btnOpacity: button.opacity property bool bCheck: false property bool bEnable: true property alias labelRate: buttonLabel.rate transform: Rotation { angle: rotationAngle } Image { id: buttonImg anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter source: bEnable?(bCheck?btnImgOnCheck:(button.pressed ?btnImgOnPressed:btnImg)):btnImgOnDisabled } Image { id: buttonIcon anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter source: bEnable?(button.pressed ?btnIconOnPressed:btnIcon):btnIconOnDisabled } HMILabel{ id: buttonLabel anchors.fill: parent anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter } }