tabledropdown fix

This commit is contained in:
marcin 2014-07-23 13:01:20 +02:00
parent d69870717f
commit 74b6483b18
5 changed files with 10 additions and 39 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.2, 2014-07-23T12:38:50. -->
<!-- Written by QtCreator 3.1.2, 2014-07-23T13:00:52. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>

View file

@ -26,10 +26,8 @@ ListView {
height: 64
width: listView.width
color: index % 2 ? "#F8F8F8" : "#FFFFFF"
function collapseDropdown() {
z = 1
dropdown.expanded = false
}
z: listView.count - index
function collapseDropdown() { dropdown.expanded = false }
Text {
id: descriptionText
@ -115,10 +113,8 @@ ListView {
if(expanded) {
listView.previousItem = delegate
listView.currentIndex = index
listView.currentItem.z = 2
}
}
onCollapsed: delegate.z = 0
onOptionClicked: {
if(option === 0)
clipboard.setText(address)

View file

@ -26,10 +26,8 @@ ListView {
height: 90
width: listView.width
color: index % 2 ? "#F8F8F8" : "#FFFFFF"
function collapseDropdown() {
z = 1
dropdown.expanded = false
}
z: listView.count - index
function collapseDropdown() { dropdown.expanded = false }
Row {
id: row1
@ -211,10 +209,8 @@ ListView {
if(expanded) {
listView.previousItem = delegate
listView.currentIndex = index
listView.currentItem.z = 2
}
}
onCollapsed: delegate.z = 0
onOptionClicked: {
if(option === 0)
clipboard.setText(address)

View file

@ -26,10 +26,8 @@ ListView {
height: 114
width: listView.width
color: index % 2 ? "#F8F8F8" : "#FFFFFF"
function collapseDropdown() {
z = 1
dropdown.expanded = false
}
z: listView.count - index
function collapseDropdown() { dropdown.expanded = false }
Row {
id: row1
@ -241,10 +239,8 @@ ListView {
if(expanded) {
listView.previousItem = delegate
listView.currentIndex = index
listView.currentItem.z = 2
}
}
onCollapsed: delegate.z = 0
onOptionClicked: {
if(option === 0)
clipboard.setText(address)

View file

@ -89,13 +89,14 @@ Item {
Timer {
id: timer
interval: 50
repeat: false
repeat: true
running: false
onTriggered: {
if(((tipItem.visible && !tipItem.containsMouse) || !tipItem.visible) && !mouseArea.containsMouse) {
tipItem.visible = false
dropdown.expanded = false
currentIndex = -1
timer.stop()
}
}
}
@ -119,9 +120,9 @@ Item {
}
}
onExited: timer.start()
preventStealing: true
z: 1
onExited: timer.start()
Item {
id: dropArea
@ -185,26 +186,8 @@ Item {
pos.y -= tipItem.height - 30
tipItem.y = pos.y + appWindow.y
tipItem.visible = true
} else {
tipItem.visible = false
}
}
// MouseArea {
// id: delegateArea
// hoverEnabled: true
// anchors.fill: parent
// propagateComposedEvents: true
// onEntered: {
// }
// onExited: tipItem.visible = false
// onClicked: {
// dropdown.optionClicked(index)
// tipItem.visible = false
// dropdown.expanded = false
// }
// }
}
}
}