don't always do the "dialog inside panel"

if a window is not outsideParentWindow or all the borders are enabled, don't do the trick
this fixes positioning of systray tooltips
This commit is contained in:
Marco Martin 2014-03-05 17:45:36 +01:00
parent 1dc6d98aa3
commit 0f4654643f

View File

@ -340,18 +340,19 @@ QPoint DialogProxy::popupPosition(QQuickItem *item, const QSize &size, Qt::Align
//not actually the current window. See QWindow::screen() documentation //not actually the current window. See QWindow::screen() documentation
QRect avail = screenForItem(item)->availableGeometry(); QRect avail = screenForItem(item)->availableGeometry();
if (outsideParentWindow && m_frameSvgItem->enabledBorders() != Plasma::FrameSvg::AllBorders) {
//make the panel look it's inside the panel, in order to not make it look cutted //make the panel look it's inside the panel, in order to not make it look cutted
switch (m_location) { switch (m_location) {
case Plasma::Types::LeftEdge: case Plasma::Types::LeftEdge:
case Plasma::Types::RightEdge: case Plasma::Types::RightEdge:
avail.setTop(qMax(avail.top(), parentGeometryBounds.top())); avail.setTop(qMax(avail.top(), parentGeometryBounds.top()));
avail.setBottom(qMin(avail.bottom(), parentGeometryBounds.bottom())); avail.setBottom(qMin(avail.bottom(), parentGeometryBounds.bottom()));
break; break;
default: default:
avail.setLeft(qMax(avail.left(), parentGeometryBounds.left())); avail.setLeft(qMax(avail.left(), parentGeometryBounds.left()));
avail.setRight(qMin(avail.right(), parentGeometryBounds.right())); avail.setRight(qMin(avail.right(), parentGeometryBounds.right()));
break; break;
}
} }
if (dialogPos.x() < avail.left()) { if (dialogPos.x() < avail.left()) {