fixes + addressbook v1 + transfer v1

This commit is contained in:
marcin
2014-07-11 00:18:36 +02:00
parent 9256e5dfac
commit f4279a9800
15 changed files with 539 additions and 248 deletions

View File

@@ -83,92 +83,98 @@ Item {
anchors.rightMargin: 10
source: "../images/dropIndicator.png"
}
MouseArea {
anchors.fill: parent
onPressed: dropdown.expanded = !dropdown.expanded
}
}
Item {
id: dropArea
anchors.left: parent.left
anchors.right: parent.right
anchors.top: head.bottom
height: dropdown.expanded ? column.height : 0
onHeightChanged: if(height === 0) dropdown.collapsed()
clip: true
MouseArea {
anchors.left: head.left
anchors.right: head.right
anchors.top: head.top
height: head.height + dropArea.height
hoverEnabled: true
onEntered: dropdown.expanded = true
onExited: dropdown.expanded = false
Behavior on height {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
Column {
id: column
Item {
id: dropArea
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
y: head.height
height: dropdown.expanded ? column.height : 0
onHeightChanged: if(height === 0) dropdown.collapsed()
clip: true
ListModel {
id: dataModel
ListElement { name: "<b>Add to adress book</b>"; icon: "../images/dropdownOption1.png" }
ListElement { name: "<b>Send to same destination</b>"; icon: "../images/dropdownSend.png" }
ListElement { name: "<b>Find similar transactions</b>"; icon: "../images/dropdownSearch.png" }
Behavior on height {
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
}
Repeater {
id: repeater
model: dataModel
Column {
id: column
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
delegate: Rectangle {
id: delegate
anchors.left: parent.left
anchors.right: parent.right
height: 30
color: delegateArea.containsMouse ? "#F0EEEE" : "#DBDBDB"
radius: index === repeater.count - 1 ? 5 : 0
ListModel {
id: dataModel
ListElement { name: "<b>Add to adress book</b>"; icon: "../images/dropdownOption1.png" }
ListElement { name: "<b>Send to same destination</b>"; icon: "../images/dropdownSend.png" }
ListElement { name: "<b>Find similar transactions</b>"; icon: "../images/dropdownSearch.png" }
}
Rectangle {
Repeater {
id: repeater
model: dataModel
delegate: Rectangle {
id: delegate
anchors.left: parent.left
anchors.top: parent.top
width: 5
height: 5
color: delegate.color
}
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
width: 5
height: 5
color: delegate.color
}
height: 30
color: delegateArea.containsMouse ? "#F0EEEE" : "#DBDBDB"
radius: index === repeater.count - 1 ? 5 : 0
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
source: icon
}
MouseArea {
id: delegateArea
hoverEnabled: true
anchors.fill: parent
onEntered: {
var pos = rootItem.mapFromItem(delegate, 30, -20)
tipItem.text = name
tipItem.x = pos.x
if(tipItem.height > 30)
pos.y -= tipItem.height - 30
tipItem.y = pos.y
tipItem.visible = true
Rectangle {
anchors.left: parent.left
anchors.top: parent.top
width: 5
height: 5
color: delegate.color
}
onExited: tipItem.visible = false
onClicked: {
dropdown.optionClicked(index)
tipItem.visible = false
dropdown.expanded = false
Rectangle {
anchors.right: parent.right
anchors.top: parent.top
width: 5
height: 5
color: delegate.color
}
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 10
source: icon
}
MouseArea {
id: delegateArea
hoverEnabled: true
anchors.fill: parent
propagateComposedEvents: true
onEntered: {
var pos = rootItem.mapFromItem(delegate, 30, -20)
tipItem.text = name
tipItem.x = pos.x
if(tipItem.height > 30)
pos.y -= tipItem.height - 30
tipItem.y = pos.y
tipItem.visible = true
}
onExited: tipItem.visible = false
onClicked: {
dropdown.optionClicked(index)
tipItem.visible = false
dropdown.expanded = false
}
}
}
}