summaryrefstree
path: root/usr/bin/qml-aircondition/com/neusoft/auto/widgets/HMIButton.qml
blob: 126c648f60bacaf6c134c3233c4f54d7e7f0998c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
*   Copyright (C) 2013 by Neusoft
*   Author : Jia Zhao <zhao-jia@neusoft.com>
*
*/

/**
 * A button with optional Text and icon .
 */

import QtQuick 2.0

HMIMouseArea{
    id: button
    width: buttonImg.width
    height: buttonImg.height
    /**
     * type:bool
     * This property holds if the Text for the button will be displayed or not.
     */
    //property alias Text: buttonLabel.visible
    /**
     * type:string
     * This property holds the text Text for the button.
     */
    property alias labelText: buttonLabel.text
    /**
     * type:color
     * This property holds the the color of text Text for the button.
     */
    property alias labelColor: buttonLabel.color
    /**
     * type:real
     * This property holds the font.pointsize of text Text 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 Text 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 alias btnImg: buttonImg.source
    /**
     * type:string
     *
     * This property holds the source url for the Button's icon.
     * It can be any image from any protocol supported by the Image element
     *
     * The default value is an empty url, which displays no icon.
     */
    property alias btnIcon: buttonIcon.source

    property alias btnImgOpacity: buttonImg.opacity


    Image {
	//linlan modify in 2014-9-1
        id: buttonImg
		anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        Image {
            id: buttonIcon
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
        }
    }

    Text{
        id: buttonLabel
        anchors.fill: parent
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter
        font.family: "方正兰亭黑简体"
        color: "white"
    }
}