~ken-vandine/address-book-app/add_profile

« back to all changes in this revision

Viewing changes to src/imports/ContactEdit/ContactDetailWithTypeEditor.qml

  • Committer: CI bot
  • Author(s): Tarmac, Renato Araujo Oliveira Filho
  • Date: 2014-06-16 13:12:46 UTC
  • mfrom: (169.1.22 release-2014-06-12)
  • Revision ID: ps-jenkins@lists.canonical.com-20140616131246-rzqpkq95ut0j8gka
Implemented contact share.
Replaced ContentHub API with QML API.
Removed ContactSearchListView component.
Moved ContactSimpleListView to the private API.
Added documentation for ContactListView properties.
Created "contactNameFilter" into ContactListView.
Update contact list visuals.
Implemented fast scroll.
Implemented contact search.
Initial refactor of autopilot tests.
Used new SDK header. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        return detailchanged
69
69
    }
70
70
 
71
 
    focus: true
72
71
    // disable listview mouse area
73
72
    __mouseArea.visible: false
74
73
    enabled: root.detail ? !root.detail.readOnly : false
107
106
            right: detailTypeSelector.right
108
107
            top: detailTypeSelector.bottom
109
108
        }
110
 
        focus: true
111
109
        height: childrenRect.height
112
110
 
113
111
        Repeater {
114
112
            id: fieldRepeater
 
113
 
115
114
            model: root.fields
116
 
 
117
 
            focus: true
118
115
            TextInputDetail {
119
116
                id: detail
120
117
                objectName: root.detail ? detailToString(root.detail.type, modelData) + "_" + root.index : ""
121
118
 
122
 
                Component.onCompleted: focus = (index === 0)
123
 
                focus: false
124
119
                detail: root.detail
125
120
                field: modelData
 
121
                focus: true
126
122
                placeholderText: root.placeholderTexts[index]
127
123
                inputMethodHints: root.inputMethodHints
128
124
                autoFormat: root.usePhoneFormat
133
129
                }
134
130
                height: root.active ? root.itemHeight + units.gu(1) : root.itemHeight
135
131
                onRemoveClicked: root.contact.removeDetail(root.detail)
136
 
                // FIXME: SDK still using QtQuick 2.0 change this to activeFocusOnTab: true on version 2.2
137
 
                KeyNavigation.backtab : index > 0 ? fieldRepeater.itemAt(index - 1) : null
138
 
                KeyNavigation.tab: index < fieldRepeater.count - 1 ? fieldRepeater.itemAt(index + 1) : null
139
132
            }
140
133
        }
141
134
        Keys.onReleased: {
148
141
            }
149
142
        }
150
143
    }
151
 
 
152
 
    // reset focus back to first field
153
 
    onActiveFocusChanged: {
154
 
        if (!activeFocus) {
155
 
            for(var i=0; i < fieldRepeater.count; i++) {
156
 
                fieldRepeater.itemAt(i).focus = (i === 0)
157
 
            }
158
 
        }
159
 
    }
160
144
}