summaryrefstree
path: root/usr/bin/qml/Carlink/LoginAccountList.qml
blob: 22f9d2170f091286b47dcb15f57ace4e9390f5dd (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
import QtQuick 2.0
import "../com/neusoft/auto/widgets"
Item {
	signal nameListClicked
	
    id: namelist
    width:230
    height: 400
    Image{
        id:nameListBk
        source: "qrc:MATERIAL/MATERIAL_M8X_SUB-LIST_280_BG"+systemCtrl.style

    }
	
	Component {
        id: cmpt
           
		HMIButton{
			id:namelistbtn
			x: 0; y: 0
			btnImg:"qrc:MATERIAL/MATERIAL_M8X_SUB-LIST_256_P"+systemCtrl.style
			HMILabel{
				id:loginname
				anchors.horizontalCenter: parent.horizontalCenter
                anchors.verticalCenter: parent.verticalCenter
				text: modelData.name
				font.pixelSize: 20   
			}
			onClicked:
            {
				console.log("LoginAccountList.qml---->>>clicked-->>index:",index);
				carlinkCtrl.setNameindex(index);
				nameListClicked();
				//namelist.visible=carlinkhome_page.isFullScreen
            }

		}
    }
	HMIListView {
        id: nameList
		
        width: nameListBk.width;
        height: nameListBk.height;
        model: mNameList
        delegate: cmpt // Refers to the delegate component
        focus: true
		
		highlightFollowsCurrentItem: true
        snapMode: ListView.SnapOneItem

        highlightRangeMode: ListView.StrictlyEnforceRange
        spacing: 2
        clip: true
        interactive: nameList.count >4 ?true : false	// less then four items , list doesn't interactive

        flickableDirection:Flickable.VerticalFlick
        scrollBar:true
        showBar:true
        scrollBar_edge:1
        scrollBar_width:4
        scrollBar_img:"qrc:MATERIAL/MATERIAL_M8X_SLIDER_BAR"+systemCtrl.style
    }
	Connections{
        target: carlinkCtrl
        onNameListChanged:{
			console.log("Connections--carlinkCtrl--mNameList-------->>>");
            nameList.model = carlinkCtrl.getNameList();
        }
    }
	 
}