import QtQuick 1.0
import "Util.js" as Utility

Rectangle {
    id:logincontainer

    radius:6
    width:450
    height: 250
    border.width:6
    border.color:"grey"
    color: "#343434";
    FontLoader { id: localFont; source: "fonts/SIMLI.TTF" } //SIMLI   //FZJLJW

    //signal accepted


    Column{
        id: logindialog
        anchors.horizontalCenter: parent.horizontalCenter;
        anchors.verticalCenter:parent.verticalCenter ;
        spacing: 20


        Row{
            id:accountInputRow
            spacing:20;
            Text {
                text: "\u5E10\u53F7"
                font.pixelSize: 23
                font.family: localFont.name
                color: "DarkOrange"
            }

            TextEntry {
                id: userName
                height: 35
                width: 250
                bgImage: 'images/button.png'

                bgImageActive:'images/button.png'

                // bgImageActive: 'images/button_pressed.png'

                fontName: localFont.name
                fontColor: "white"
                fontSize: 14

                text: ""
            }
        }

        Row{
            id:passwordInputRow
            spacing:20;
            Text {

                text: "\u5BC6\u7801"
                font.pixelSize: 23
                font.family: localFont.name
                color: "DarkOrange"
            }


            PasswordTextEntry {
                id: password
             //   echomode: 'TextInput.Password'
                height: 35
                width: 250
                bgImage: 'images/button.png'
                bgImageActive:'images/button.png'

                // bgImageActive: 'images/button_pressed.png'

                fontName: localFont.name
                fontColor: "white"
                fontSize: 14

                text: ""
            }
        }



        Button {
            id: loginbutton
            anchors.horizontalCenter: parent.horizontalCenter;
            width:  100
            height: 40
            text: "\u8FDB\u5165" //½øÈë
            bgImage: "images/button.png"
            bgImagePressed: "images/button_pressed.png"
            onClicked: {
                //busyindicator
                //getAuth().login(userName.getText(), password.getText());
                Utility.login(userName.getText(), password.getText());
                //logincontainer.opacity=0;

                //logincontainer.accepted();
            }
        }

        Text
        {

            id: logininfo;
            anchors.horizontalCenter:parent.horizontalCenter;

            font {
                family: localFont.name
                pointSize: 13
                weight: Font.Bold
            }
            text: "\u7528\u6237\u540D\u5BC6\u7801\u8F93\u5165\u9519\u8BEF\u6216\u5E10\u53F7\u672A\u7ECF\u6388\u6743"
            opacity: 0
            color:"DarkOrange"

        }


    }

    function showlogininfo()
    {
        logininfo.opacity=1;
    }


}
