drop QRect::setX/Y from all classes

--they can change the QRect width and height
and this is not the desired behavior.
moveLeft/Top are much better replacements.
pull/11/head
Michail Vourlakos 5 years ago
parent 73b3fb234f
commit 43d91c9b63

@ -118,7 +118,7 @@ void LayoutName::paint(QPainter *painter, const QStyleOptionViewItem &option, co
myOptionS.rect = destinationS;
myOptionE.rect = destinationE;
myOptionMain.rect.setX(option.rect.x() + startWidth);
myOptionMain.rect.moveLeft(option.rect.x() + startWidth);
myOptionMain.rect.setWidth(option.rect.width() - startWidth - endWidth);
QStyledItemDelegate::paint(painter, myOptionMain, index);

@ -95,20 +95,20 @@ void FloatingGapWindow::updateGeometry()
if (m_latteView->location() == Plasma::Types::BottomEdge) {
int xF = qMax(m_latteView->screenGeometry().left(), m_latteView->absoluteGeometry().left());
newGeometry.setX(xF);
newGeometry.setY(m_latteView->screenGeometry().bottom() - m_thickness);
newGeometry.moveLeft(xF);
newGeometry.moveTop(m_latteView->screenGeometry().bottom() - m_thickness);
} else if (m_latteView->location() == Plasma::Types::TopEdge) {
int xF = qMax(m_latteView->screenGeometry().left(), m_latteView->absoluteGeometry().left());
newGeometry.setX(xF);
newGeometry.setY(m_latteView->screenGeometry().top());
newGeometry.moveLeft(xF);
newGeometry.moveTop(m_latteView->screenGeometry().top());
} else if (m_latteView->location() == Plasma::Types::LeftEdge) {
int yF = qMax(m_latteView->screenGeometry().top(), m_latteView->absoluteGeometry().top());
newGeometry.setX(m_latteView->screenGeometry().left());
newGeometry.setY(yF);
newGeometry.moveLeft(m_latteView->screenGeometry().left());
newGeometry.moveTop(yF);
} else if (m_latteView->location() == Plasma::Types::RightEdge) {
int yF = qMax(m_latteView->screenGeometry().top(), m_latteView->absoluteGeometry().top());
newGeometry.setX(m_latteView->screenGeometry().right() - m_thickness);
newGeometry.setY(yF);
newGeometry.moveLeft(m_latteView->screenGeometry().right() - m_thickness);
newGeometry.moveTop(yF);
}
if (m_latteView->formFactor() == Plasma::Types::Horizontal) {

@ -109,20 +109,20 @@ void ScreenEdgeGhostWindow::updateGeometry()
if (m_latteView->location() == Plasma::Types::BottomEdge) {
int xF = qMax(m_latteView->screenGeometry().left(), m_latteView->absoluteGeometry().left() - lengthDifference);
newGeometry.setX(xF);
newGeometry.setY(m_latteView->screenGeometry().bottom() - m_thickness);
newGeometry.moveLeft(xF);
newGeometry.moveTop(m_latteView->screenGeometry().bottom() - m_thickness);
} else if (m_latteView->location() == Plasma::Types::TopEdge) {
int xF = qMax(m_latteView->screenGeometry().left(), m_latteView->absoluteGeometry().left() - lengthDifference);
newGeometry.setX(xF);
newGeometry.setY(m_latteView->screenGeometry().top());
newGeometry.moveLeft(xF);
newGeometry.moveTop(m_latteView->screenGeometry().top());
} else if (m_latteView->location() == Plasma::Types::LeftEdge) {
int yF = qMax(m_latteView->screenGeometry().top(), m_latteView->absoluteGeometry().top() - lengthDifference);
newGeometry.setX(m_latteView->screenGeometry().left());
newGeometry.setY(yF);
newGeometry.moveLeft(m_latteView->screenGeometry().left());
newGeometry.moveTop(yF);
} else if (m_latteView->location() == Plasma::Types::RightEdge) {
int yF = qMax(m_latteView->screenGeometry().top(), m_latteView->absoluteGeometry().top() - lengthDifference);
newGeometry.setX(m_latteView->screenGeometry().right() - m_thickness);
newGeometry.setY(yF);
newGeometry.moveLeft(m_latteView->screenGeometry().right() - m_thickness);
newGeometry.moveTop(yF);
}
if (m_latteView->formFactor() == Plasma::Types::Horizontal) {

Loading…
Cancel
Save