diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/Qt5Graphics_Controls.cxx | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5Instance.cxx | 2 | ||||
-rw-r--r-- | vcl/qt5/Qt5Widget.cxx | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index 73a47e5e5ffa..32a2d132efc5 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -518,7 +518,11 @@ bool Qt5Graphics_Controls::drawNativeControl(ControlType type, ControlPart part, option.sliderPosition = sbVal->mnCur; option.pageStep = sbVal->mnVisibleSize; if (part == ControlPart::DrawBackgroundHorz) - option.upsideDown = sbVal->maButton1Rect.Left() > sbVal->maButton2Rect.Left(); + option.upsideDown + = (QGuiApplication::isRightToLeft() + && sbVal->maButton1Rect.Left() < sbVal->maButton2Rect.Left()) + || (QGuiApplication::isLeftToRight() + && sbVal->maButton1Rect.Left() > sbVal->maButton2Rect.Left()); //setup the active control... always the slider if (sbVal->mnThumbState & ControlState::ROLLOVER) diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 6c872b84cb0a..86c94ba792de 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -247,6 +247,8 @@ void Qt5Instance::AfterAppInit() // as this otherwise overrides the individual desktop icons on X11. if (QGuiApplication::platformName() == "wayland") QGuiApplication::setDesktopFileName(QStringLiteral("libreoffice-startcenter.desktop")); + QGuiApplication::setLayoutDirection(AllSettings::GetLayoutRTL() ? Qt::RightToLeft + : Qt::LeftToRight); } void Qt5Instance::deleteObjectLater(QObject* pObject) { pObject->deleteLater(); } diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 657c5e8e73f7..dac72b0c764e 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -141,7 +141,9 @@ void Qt5Widget::handleMouseButtonEvent(const Qt5Frame& rFrame, QMouseEvent* pEve } aEvent.mnTime = pEvent->timestamp(); - aEvent.mnX = static_cast<long>(pEvent->pos().x()); + aEvent.mnX = static_cast<long>(QGuiApplication::isLeftToRight() + ? pEvent->pos().x() + : rFrame.GetQWidget()->width() - pEvent->pos().x()); aEvent.mnY = static_cast<long>(pEvent->pos().y()); aEvent.mnCode = GetKeyModCode(pEvent->modifiers()) | GetMouseModCode(pEvent->buttons()); @@ -166,7 +168,7 @@ void Qt5Widget::mouseMoveEvent(QMouseEvent* pEvent) SalMouseEvent aEvent; aEvent.mnTime = pEvent->timestamp(); - aEvent.mnX = point.x(); + aEvent.mnX = QGuiApplication::isLeftToRight() ? point.x() : width() - point.x(); aEvent.mnY = point.y(); aEvent.mnCode = GetKeyModCode(pEvent->modifiers()) | GetMouseModCode(pEvent->buttons()); aEvent.mnButton = 0; @@ -191,7 +193,7 @@ void Qt5Widget::wheelEvent(QWheelEvent* pEvent) aEvent.mbHorz = nDelta == 0; if (aEvent.mbHorz) { - nDelta = pEvent->angleDelta().x(); + nDelta = (QGuiApplication::isLeftToRight() ? -1 : 1) * pEvent->angleDelta().x(); if (!nDelta) return; |