import com.nokia.meego 1.0
import "uiconstants.js" as UiConstants
-
BorderImage {
+ id: root
property alias text: searchField.text
width: parent.width
- border.left: 10
- border.right: 10
- border.top: 10
- border.bottom: 10
- height: visible ? UiConstants.SearchBarDefaultHeight : 0
+ border {
+ left: 10
+ right: 10
+ top: 10
+ bottom: 10
+ }
+ height: 0
source: style.background
+ states: [
+ State {
+ name: "visible"
+ when: root.visible
+ changes: [
+ PropertyChanges {
+ target: root
+ height: UiConstants.SearchBarDefaultHeight
+ }
+ ]
+ }
+ ]
+ transitions: Transition {
+ PropertyAnimation {
+ duration: 200
+ easing.type: Easing.OutBounce
+ target: root
+ properties: "height"
+ }
+ }
ToolBarStyle {
id: style
}
- Item {
- id: spacerTop
- width: parent.width
- height: UiConstants.DefaultMargin
- }
- Item {
- id: spacerLeft
- anchors.left: parent.left
- width: UiConstants.DefaultMargin
- height: searchField.height
- }
- Item {
- id: spacerRight
- anchors.right: parent.right
- width: UiConstants.DefaultMargin
- height: searchField.height
- }
-
TextField {
id: searchField
- anchors.top: spacerTop.bottom
- anchors.left: spacerLeft.right
- anchors.right: spacerRight.left
+ anchors {
+ fill: parent
+ leftMargin: UiConstants.DefaultMargin
+ rightMargin: UiConstants.DefaultMargin
+ topMargin: UiConstants.DefaultMargin
+ bottomMargin: UiConstants.DefaultMargin
+ }
placeholderText: qsTr("Search")
inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
platformStyle: TextFieldStyle { paddingRight: clearButton.width }
}
}
}
- Item {
- id: spacerBottom
- width: parent.width
- anchors.top: searchField.bottom
- height: UiConstants.DefaultMargins
- }
}