mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-02 19:27:38 +08:00
fix #259
This commit is contained in:
parent
d05c60c3d7
commit
f913263de6
@ -9,7 +9,6 @@ Rectangle {
|
|||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
property string text: "请选择日期"
|
property string text: "请选择日期"
|
||||||
property var window : Window.window
|
|
||||||
id:control
|
id:control
|
||||||
color: {
|
color: {
|
||||||
if(mouse_area.containsMouse){
|
if(mouse_area.containsMouse){
|
||||||
@ -30,6 +29,10 @@ Rectangle {
|
|||||||
popup.showPopup()
|
popup.showPopup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Item{
|
||||||
|
id:d
|
||||||
|
property var window : Window.window
|
||||||
|
}
|
||||||
FluText{
|
FluText{
|
||||||
id:text_date
|
id:text_date
|
||||||
anchors{
|
anchors{
|
||||||
@ -97,12 +100,12 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
function showPopup() {
|
function showPopup() {
|
||||||
var pos = control.mapToItem(null, 0, 0)
|
var pos = control.mapToItem(null, 0, 0)
|
||||||
if(window.height>pos.y+control.height+container.height){
|
if(d.window.height>pos.y+control.height+container.height){
|
||||||
popup.y = control.height
|
popup.y = control.height
|
||||||
} else if(pos.y>container.height){
|
} else if(pos.y>container.height){
|
||||||
popup.y = -container.height
|
popup.y = -container.height
|
||||||
} else {
|
} else {
|
||||||
popup.y = window.height-(pos.y+container.height)
|
popup.y = d.window.height-(pos.y+container.height)
|
||||||
}
|
}
|
||||||
popup.x = -(popup.width-control.width)/2
|
popup.x = -(popup.width-control.width)/2
|
||||||
popup.open()
|
popup.open()
|
||||||
|
@ -32,6 +32,10 @@ Button{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Item{
|
||||||
|
id: d
|
||||||
|
property var window : Window.window
|
||||||
|
}
|
||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
popup.showPopup()
|
popup.showPopup()
|
||||||
@ -73,12 +77,12 @@ Button{
|
|||||||
}
|
}
|
||||||
function showPopup() {
|
function showPopup() {
|
||||||
var pos = control.mapToItem(null, 0, 0)
|
var pos = control.mapToItem(null, 0, 0)
|
||||||
if(window.height>pos.y+control.height+container.height){
|
if(d.window.height>pos.y+control.height+container.height){
|
||||||
popup.y = control.height
|
popup.y = control.height
|
||||||
} else if(pos.y>container.height){
|
} else if(pos.y>container.height){
|
||||||
popup.y = -container.height
|
popup.y = -container.height
|
||||||
} else {
|
} else {
|
||||||
popup.y = window.height-(pos.y+container.height)
|
popup.y = d.window.height-(pos.y+container.height)
|
||||||
}
|
}
|
||||||
popup.x = -(popup.width-control.width)/2
|
popup.x = -(popup.width-control.width)/2
|
||||||
popup.open()
|
popup.open()
|
||||||
|
Loading…
Reference in New Issue
Block a user