diff --git a/containments/desktop/plugins/folder/subdialog.cpp b/containments/desktop/plugins/folder/subdialog.cpp --- a/containments/desktop/plugins/folder/subdialog.cpp +++ b/containments/desktop/plugins/folder/subdialog.cpp @@ -20,6 +20,7 @@ #include "subdialog.h" +#include #include SubDialog::SubDialog(QQuickItem *parent) : PlasmaQuick::Dialog(parent) @@ -42,12 +43,20 @@ pos.setX(pos.x() + item->width() / 2); pos.setY(pos.y() + item->height() / 2); + if (QGuiApplication::layoutDirection() == Qt::RightToLeft) { + pos.setX(pos.x() - size.width()); + } + QRect avail = availableScreenRectForItem(item); if (pos.x() + size.width() > avail.right()) { pos.setX(pos.x() - size.width()); } + if (pos.x() < avail.left()) { + pos.setX(pos.x() + size.width()); + } + if (pos.y() + size.height() > avail.bottom()) { pos.setY(pos.y() - size.height()); }