mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-22 10:40:10 +08:00
fix bug
This commit is contained in:
parent
b8ef9169b9
commit
04c52b1b25
@ -19,16 +19,20 @@ FluButton {
|
||||
}
|
||||
iconColor:control.textColor
|
||||
}
|
||||
Item{
|
||||
id: d
|
||||
property var window: Window.window
|
||||
}
|
||||
onClicked: {
|
||||
if(menu.count !==0){
|
||||
var pos = control.mapToItem(null, 0, 0)
|
||||
var containerHeight = menu.count*36
|
||||
if(window.height>pos.y+control.height+containerHeight){
|
||||
if(d.window.height>pos.y+control.height+containerHeight){
|
||||
menu.y = control.height
|
||||
}else if(pos.y>containerHeight){
|
||||
menu.y = -containerHeight
|
||||
}else{
|
||||
menu.y = window.height-(pos.y+containerHeight)
|
||||
menu.y = d.window.height-(pos.y+containerHeight)
|
||||
}
|
||||
menu.open()
|
||||
}
|
||||
|
@ -20,16 +20,20 @@ FluButton {
|
||||
}
|
||||
iconColor:control.textColor
|
||||
}
|
||||
Item{
|
||||
id: d
|
||||
property var window: Window.window
|
||||
}
|
||||
onClicked: {
|
||||
if(menu.count !==0){
|
||||
var pos = control.mapToItem(null, 0, 0)
|
||||
var containerHeight = menu.count*36
|
||||
if(window.height>pos.y+control.height+containerHeight){
|
||||
if(d.window.height>pos.y+control.height+containerHeight){
|
||||
menu.y = control.height
|
||||
}else if(pos.y>containerHeight){
|
||||
menu.y = -containerHeight
|
||||
}else{
|
||||
menu.y = window.height-(pos.y+containerHeight)
|
||||
menu.y = d.window.height-(pos.y+containerHeight)
|
||||
}
|
||||
menu.open()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user