@@ -178,60 +178,78 @@ Item {
178 panelForegroundColor: config.foregroundColor
178 panelForegroundColor: config.foregroundColor
179 property var config: PageHeadConfiguration {
179 property var config: PageHeadConfiguration {
180 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : Theme.palette.normal.baseText
180 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : Theme.palette.normal.baseText
181− backAction: Action {
185− headerContainer.showSearch = false;
189− property var contents: TextField {
182+ property var contents: Item {
183+ anchors.fill: parent
190− id: searchTextField
186+ id: searchTextField
191− objectName: "searchTextField"
187+ objectName: "searchTextField"
192− inputMethodHints: Qt.ImhNoPredictiveText
188+ inputMethodHints: Qt.ImhNoPredictiveText
193− hasClearButton: false
189+ hasClearButton: false
194− anchors {
190+ anchors {
195− fill: parent
191+ top: parent.top
196− leftMargin: units.gu(1)
197− topMargin: units.gu(1)
192+ topMargin: units.gu(1)
194+ bottom: parent.bottom
198− bottomMargin: units.gu(1)
195+ bottomMargin: units.gu(1)
196+ right: cancelLabel.left
199− rightMargin: root.width > units.gu(60) ? root.width - units.gu(40) : units.gu(1)
197+ rightMargin: units.gu(1)
202− secondaryItem: AbstractButton {
200+ secondaryItem: AbstractButton {
203− height: searchTextField.height
201+ height: searchTextField.height
204− width: height
202+ width: height
205− enabled: searchTextField.text.length > 0
203+ enabled: searchTextField.text.length > 0
206+ objectName: "clearIcon"
207+ anchors.fill: parent
208+ anchors.margins: units.gu(.75)
209+ source: "image://theme/clear"
210+ opacity: searchTextField.text.length > 0
211+ visible: opacity > 0
212+ Behavior on opacity {
213+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
207− Image {
217+ onClicked: {
208− objectName: "clearIcon"
218+ root.resetSearch(true);
209− anchors.fill: parent
219+ root.openPopup();
210− anchors.margins: units.gu(.75)
211− source: "image://theme/clear"
212− opacity: searchTextField.text.length > 0
213− visible: opacity > 0
214− Behavior on opacity {
215− UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
219− onClicked: {
223+ onActiveFocusChanged: {
220− root.resetSearch(true);
224+ if (activeFocus) {
225+ root.searchTextFieldFocused();
221− root.openPopup();
226+ root.openPopup();
225− onActiveFocusChanged: {
230+ onTextChanged: {
226− if (activeFocus) {
231+ if (text != "") {
227− root.searchTextFieldFocused();
232+ closePopup(/* keepFocus */true);
228− root.openPopup();
233+ }
232− onTextChanged: {
237+ Label {
233− if (text != "") {
238+ id: cancelLabel
234− closePopup(/* keepFocus */true);
239+ text: i18n.tr("Cancel")
240+ verticalAlignment: Text.AlignVCenter
244+ bottom: parent.bottom
245+ margins: units.gu(1)
248+ anchors.fill: parent
251+ headerContainer.showSearch = false;