mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
update
This commit is contained in:
@ -74,16 +74,18 @@ Button {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
var pos = control.mapToItem(null, 0, 0)
|
||||
var containerHeight = menu.getContainerHeight()
|
||||
if(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)
|
||||
if(items && menu.getContainerCount()!==0){
|
||||
var pos = control.mapToItem(null, 0, 0)
|
||||
var containerHeight = menu.getContainerHeight()
|
||||
if(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.open()
|
||||
}
|
||||
menu.open()
|
||||
}
|
||||
|
||||
FluMenu{
|
||||
|
@ -61,4 +61,8 @@ Menu {
|
||||
return container.height
|
||||
}
|
||||
|
||||
function getContainerCount(){
|
||||
return container.children.length
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,19 +1,5 @@
|
||||
MetaInfo {
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluWindow"
|
||||
icon: "images/button-icon16.png"
|
||||
|
||||
ItemLibraryEntry {
|
||||
name: "FluWindow"
|
||||
category: "FluentUI - Controls"
|
||||
libraryIcon: "images/button-icon.png"
|
||||
version: "1.0"
|
||||
requiredImport: "FluentUI"
|
||||
toolTip: qsTr("FluWindow")
|
||||
}
|
||||
}
|
||||
|
||||
Type {
|
||||
name: "FluentUI.Controls.FluTextButton"
|
||||
icon: "images/button-icon16.png"
|
||||
@ -154,4 +140,5 @@ MetaInfo {
|
||||
Property { name: "text"; type: "binding"; value: "qsTr(\"Text\")" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user