import QtQuick 1.1 import com.nokia.symbian 1.1 import "UIConstants.js" as UI import "constants.js" as ExtrasConstants import Qt.labs.components 1.1 Item { id: filterHeader height: searchInput.height + UI.DEFAULT_MARGIN width: parent.width property alias searchText: searchInput.text signal nameFilterChanged(string filterName) Row { id: searchArea anchors.fill: parent anchors.margins: UI.DEFAULT_MARGIN spacing: 10 TextField { id: searchInput placeholderText: "Поиск" width: parent.width - searchButton.width - 10 anchors.verticalCenter: parent.verticalCenter Image { id: clearText anchors { top: parent.top; right: parent.right; margins: platformStyle.paddingMedium } fillMode: Image.PreserveAspectFit smooth: true visible: searchInput.text source: searchInputMouseArea.pressed ? "image://theme/qtg_graf_textfield_clear_pressed" : "image://theme/qtg_graf_textfield_clear_normal" height: parent.height - platformStyle.paddingMedium * 2 width: parent.height - platformStyle.paddingMedium * 2 MouseArea { id: searchInputMouseArea anchors.fill: parent onClicked: { searchInput.text = ''; nameFilterChanged(''); searchInput.focus = false; } } } } Button { id: searchButton text: "Найти" anchors.verticalCenter: parent.verticalCenter width: 100 enabled: searchInput.text !== '' onClicked: { nameFilterChanged(searchInput.text) } } } }