Changeset View
Changeset View
Standalone View
Standalone View
xdgshellclient.cpp
Show First 20 Lines • Show All 1701 Lines • ▼ Show 20 Line(s) | 1687 | if (!inBounds(popupPosition, Qt::LeftEdge | Qt::RightEdge)) { | |||
---|---|---|---|---|---|
1702 | } | 1702 | } | ||
1703 | } | 1703 | } | ||
1704 | } | 1704 | } | ||
1705 | if (constraintAdjustments & PositionerConstraint::SlideX) { | 1705 | if (constraintAdjustments & PositionerConstraint::SlideX) { | ||
1706 | if (!inBounds(popupPosition, Qt::LeftEdge)) { | 1706 | if (!inBounds(popupPosition, Qt::LeftEdge)) { | ||
1707 | popupPosition.moveLeft(bounds.x()); | 1707 | popupPosition.moveLeft(bounds.x()); | ||
1708 | } | 1708 | } | ||
1709 | if (!inBounds(popupPosition, Qt::RightEdge)) { | 1709 | if (!inBounds(popupPosition, Qt::RightEdge)) { | ||
1710 | // moveRight suffers from the classic QRect off by one issue | 1710 | popupPosition.moveRight(bounds.right()); | ||
broulik: So what is this comment about then? | |||||
It says that you can't do popupPosition.moveRight(bounds.x() + bounds.width()); zzag: It says that you can't do
```lang=cpp
popupPosition.moveRight(bounds.x() + bounds. | |||||
1711 | popupPosition.moveLeft(bounds.x() + bounds.width() - size.width()); | | |||
1712 | } | 1711 | } | ||
1713 | } | 1712 | } | ||
1714 | if (constraintAdjustments & PositionerConstraint::ResizeX) { | 1713 | if (constraintAdjustments & PositionerConstraint::ResizeX) { | ||
1715 | QRect unconstrainedRect = popupPosition; | 1714 | QRect unconstrainedRect = popupPosition; | ||
1716 | 1715 | | |||
1717 | if (!inBounds(unconstrainedRect, Qt::LeftEdge)) { | 1716 | if (!inBounds(unconstrainedRect, Qt::LeftEdge)) { | ||
1718 | unconstrainedRect.setLeft(bounds.left()); | 1717 | unconstrainedRect.setLeft(bounds.left()); | ||
1719 | } | 1718 | } | ||
Show All 25 Lines | 1729 | if (!inBounds(popupPosition, Qt::TopEdge | Qt::BottomEdge)) { | |||
1745 | } | 1744 | } | ||
1746 | } | 1745 | } | ||
1747 | } | 1746 | } | ||
1748 | if (constraintAdjustments & PositionerConstraint::SlideY) { | 1747 | if (constraintAdjustments & PositionerConstraint::SlideY) { | ||
1749 | if (!inBounds(popupPosition, Qt::TopEdge)) { | 1748 | if (!inBounds(popupPosition, Qt::TopEdge)) { | ||
1750 | popupPosition.moveTop(bounds.y()); | 1749 | popupPosition.moveTop(bounds.y()); | ||
1751 | } | 1750 | } | ||
1752 | if (!inBounds(popupPosition, Qt::BottomEdge)) { | 1751 | if (!inBounds(popupPosition, Qt::BottomEdge)) { | ||
1753 | popupPosition.moveTop(bounds.y() + bounds.height() - size.height()); | 1752 | popupPosition.moveBottom(bounds.bottom()); | ||
1754 | } | 1753 | } | ||
1755 | } | 1754 | } | ||
1756 | if (constraintAdjustments & PositionerConstraint::ResizeY) { | 1755 | if (constraintAdjustments & PositionerConstraint::ResizeY) { | ||
1757 | QRect unconstrainedRect = popupPosition; | 1756 | QRect unconstrainedRect = popupPosition; | ||
1758 | 1757 | | |||
1759 | if (!inBounds(unconstrainedRect, Qt::TopEdge)) { | 1758 | if (!inBounds(unconstrainedRect, Qt::TopEdge)) { | ||
1760 | unconstrainedRect.setTop(bounds.top()); | 1759 | unconstrainedRect.setTop(bounds.top()); | ||
1761 | } | 1760 | } | ||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |
So what is this comment about then?