summaryrefslogtreecommitdiff
path: root/vcl/qt5
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-06-28 00:48:01 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-06-28 03:10:32 +0200
commit9eda78fd53fe3c76eb9d4b63add68f266f551b10 (patch)
tree599e74a5114d652d504d4f4322b255488b246b73 /vcl/qt5
parent8ed11b7289533bd609fbcb2adfb7b2982ef6fe22 (diff)
tdf#131991 Qt5 RTL mirror mouse wheel X position
Just like all the other events, the mouse wheels X position must be mirrord in LO RTL mode. Change-Id: I28e8da0455d941f42f869b08edcdbe570de366c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97338 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r--vcl/qt5/Qt5Widget.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 1c7a130aabe4..0ef305f42949 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -192,7 +192,9 @@ void Qt5Widget::wheelEvent(QWheelEvent* pEvent)
const Point aPos = toPoint(pEvent->pos() * m_rFrame.devicePixelRatioF());
SalWheelMouseEvent aEvent;
- aEvent.mnX = aPos.X();
+ aEvent.mnX = QGuiApplication::isLeftToRight()
+ ? aPos.X()
+ : round(width() * m_rFrame.devicePixelRatioF()) - aPos.X();
aEvent.mnY = aPos.Y();
aEvent.mnTime = pEvent->timestamp();
aEvent.mnCode = GetKeyModCode(pEvent->modifiers()) | GetMouseModCode(pEvent->buttons());