aboutsummaryrefslogtreecommitdiff
path: root/components/TableDropdown.qml
diff options
context:
space:
mode:
authormarcin <z.krzysztoff7@gmail.com>2014-07-11 00:18:36 +0200
committermarcin <z.krzysztoff7@gmail.com>2014-07-11 00:18:36 +0200
commitf4279a9800befdeab6a787d9e029347ff8fcad3d (patch)
tree4dea4faa07ea14e260ad9f0daf3c4472562c483f /components/TableDropdown.qml
parent9256e5dfacd8be00e27569f9dcba5327e2f76926 (diff)
downloadmonzero-gui-f4279a9800befdeab6a787d9e029347ff8fcad3d.tar.gz
monzero-gui-f4279a9800befdeab6a787d9e029347ff8fcad3d.tar.xz
monzero-gui-f4279a9800befdeab6a787d9e029347ff8fcad3d.zip
fixes + addressbook v1 + transfer v1
Diffstat (limited to 'components/TableDropdown.qml')
-rw-r--r--components/TableDropdown.qml148
1 files changed, 77 insertions, 71 deletions
diff --git a/components/TableDropdown.qml b/components/TableDropdown.qml
index 89cec3de..fb248d19 100644
--- a/components/TableDropdown.qml
+++ b/components/TableDropdown.qml
@@ -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
-
- Behavior on height {
- NumberAnimation { duration: 100; easing.type: Easing.InQuad }
- }
+ 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
- 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 {
- anchors.left: parent.left
- anchors.top: parent.top
- width: 5
- height: 5
- color: delegate.color
- }
+ Repeater {
+ id: repeater
+ model: dataModel
- Rectangle {
+ delegate: Rectangle {
+ id: delegate
+ anchors.left: parent.left
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
- }
+ Rectangle {
+ 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
+ }
- 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
+ Image {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: 10
+ source: icon
}
- onExited: tipItem.visible = false
- onClicked: {
- dropdown.optionClicked(index)
- tipItem.visible = false
- dropdown.expanded = false
+
+ 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
+ }
}
}
}