朱子楚\zhuzi 2023-06-03 08:27:56 +08:00
commit b2328ba82c
1 changed files with 11 additions and 7 deletions

View File

@ -6,6 +6,7 @@ FluTextBox{
property var items:[]
property string emptyText: "没有找到结果"
property int autoSuggestBoxReplacement: FluentIcons.Search
property var window : Window.window
signal itemClicked(var data)
signal handleClicked
id:control
@ -22,17 +23,11 @@ FluTextBox{
y:control.height
focus: false
enter: Transition {
NumberAnimation {
property: "y"
from:0
to:control_popup.y
duration: 150
}
NumberAnimation {
property: "opacity"
from:0
to:1
duration: 150
duration: 83
}
}
onVisibleChanged: {
@ -41,6 +36,7 @@ FluTextBox{
}
}
background: Rectangle{
id:container
width: control.width
radius: 4
FluShadow{
@ -118,6 +114,14 @@ FluTextBox{
onTextChanged: {
loadData()
if(d.flagVisible){
var pos = control.mapToItem(null, 0, 0)
if(window.height>pos.y+control.height+container.height){
control_popup.y = control.height
} else if(pos.y>container.height){
control_popup.y = -container.height
} else {
popup.y = window.height-(pos.y+container.height)
}
control_popup.visible = true
}
}