diff --git a/containment.cpp b/containment.cpp index ff81ce82f..fde0a3b89 100644 --- a/containment.cpp +++ b/containment.cpp @@ -913,7 +913,11 @@ void Containment::Private::containmentConstraintsEvent(Plasma::Constraints const //defaulting to Horizontal right now } else { toolBox->setOrientation(Qt::Horizontal); - toolBox->setPos(q->geometry().width(), q->geometry().height()/2 - toolBox->boundingRect().height()/2); + if (QApplication::layoutDirection() == Qt::RightToLeft) { + toolBox->setPos(q->geometry().left(), q->geometry().height()/2 - toolBox->boundingRect().height()/2); + } else { + toolBox->setPos(q->geometry().width(), q->geometry().height()/2 - toolBox->boundingRect().height()/2); + } } } else { toolBox->setPos(q->geometry().right() - qAbs(toolBox->boundingRect().width()), 0); diff --git a/paneltoolbox.cpp b/paneltoolbox.cpp index 0516965f6..968b1857b 100644 --- a/paneltoolbox.cpp +++ b/paneltoolbox.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -114,6 +115,8 @@ QRectF PanelToolbox::boundingRect() const if (orientation() == Qt::Vertical) { return QRectF(0, 0, size()*2, -size()); //horizontal + } else if (QApplication::layoutDirection() == Qt::RightToLeft) { + return QRectF(0, 0, size(), size()*2); } else { return QRectF(0, 0, -size(), size()*2); } @@ -163,6 +166,8 @@ void PanelToolbox::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti if (orientation() == Qt::Vertical) { iconRect = QRect(QPoint(gradientCenter.x() - iconSize().width()/2, (int)boundingRect().top() - iconSize().height() - 2), iconSize()); + } else if (QApplication::layoutDirection() == Qt::RightToLeft) { + iconRect = QRect(QPoint(2, gradientCenter.y() - iconSize().height()/2), iconSize()); } else { iconRect = QRect(QPoint((int)boundingRect().left() - iconSize().width() + 2, gradientCenter.y() - iconSize().height()/2), iconSize()); } @@ -188,6 +193,8 @@ QPainterPath PanelToolbox::shape() const if (orientation() == Qt::Vertical) { path.arcTo(QRectF(boundingRect().center().x() - toolSize, boundingRect().top() - toolSize, toolSize*2, toolSize*2), 0, 180); + } else if (QApplication::layoutDirection() == Qt::RightToLeft) { + path.arcTo(QRectF(boundingRect().left() - toolSize, boundingRect().center().y() - toolSize, toolSize*2, toolSize*2), 90, -180); } else { path.arcTo(QRectF(boundingRect().left() - toolSize, boundingRect().center().y() - toolSize, toolSize*2, toolSize*2), 90, 180); }