PopupTips: Fix multi-screen position

pull/13/head
reionwong 5 years ago
parent 4bdd71ff5d
commit 97438279a9

@ -81,20 +81,20 @@ Window {
var posY = control.position.y
// left
if (posX < 0)
if (posX < Screen.x)
posX = FishUI.Units.smallSpacing
// top
if (posY < 0)
if (posY < Screen.y)
posY = FishUI.Units.smallSpacing
// right
if (posX + control.width > Screen.width)
posX = Screen.width - control.width - 1
if (posX + control.width > Screen.x + Screen.width)
posX = Screen.x + Screen.width - control.width - 1
// bottom
if (posY > control.height > Screen.width)
posY = Screen.width - control.width - 1
if (posY > control.height > Screen.y + Screen.width)
posY = Screen.y + Screen.width - control.width - 1
control.x = posX
control.y = posY

@ -42,6 +42,7 @@ Window {
property alias compositing: windowHelper.compositing
property var contentTopMargin: _header.height
property var windowRadius: FishUI.Theme.bigRadius
property alias helper: windowHelper
// Other
property bool isMaximized: control.visibility === Window.Maximized

Loading…
Cancel
Save