diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-06-06 06:22:00 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-06-13 23:19:36 +0200 |
commit | dc326926b0adc35b6ebefa7705ee5a3f133f5c88 (patch) | |
tree | 98eff452c94d48197fa97161247d709862b05f66 | |
parent | bcca1cf28cbd6c961d59bd8b8a8e58184dfc3823 (diff) |
VCL make horizontal scrolling depend on RTL
This is easiest to test in calc. We have two test cases, because
the document and the GUI can either have different or equal RTL
settings. This fixes the horizontal border scrolling for me on
Linux with gen, gtk / gtk3 and qt5 /kde5.
It looks a bit strange that this inverts the delta, if the RTL
settings are equal, but it seems not all toolkits invert the
delta in RTL mode, like Qt does.
I also tried to implement this inside ScrollBar::ImplScroll, but
the Scrollbar has no idea of the wheel event origin, the only one
which must be inverted.
Change-Id: I239cf6528de95ad581834ec77a13f582aeff5a91
Reviewed-on: https://gerrit.libreoffice.org/73923
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r-- | vcl/source/window/window2.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index a5174bb8e367..c38d0f7cdefc 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -665,10 +665,9 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd, nLines = pData->GetNotchDelta() * nScrollLines; if ( nLines ) { - ImplHandleScroll( nullptr, - 0L, - pData->IsHorz() ? pHScrl : pVScrl, - nLines ); + ImplHandleScroll(nullptr, 0L, pData->IsHorz() ? pHScrl : pVScrl, + pData->IsHorz() && pHScrl && (AllSettings::GetLayoutRTL() == pHScrl->IsRTLEnabled()) + ? -nLines : nLines); bRet = true; } } |