diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-03-07 21:36:49 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-03-07 21:51:26 +0200 |
commit | 847583867903cc7e2dd1abaeaef5245c9310243a (patch) | |
tree | e58c11ead009a05e431af58bd6e30c64c33a61b2 /vcl | |
parent | a9c6211a5229362b9fb6645d0c3a631caaf59790 (diff) |
Some further hacks for scrolling on touch devices, but no cigar
The scrolling concepts seem quite obscure and firmly tied to concepts like
"pages" and "lines". For touch devices one would want to be able to request
scrolling simply in *pixels*.
It is the scrollbar objects (in vcl and toolkit, and yes, UNO is also involved
over in toolkit) that all the action goes through so they must exist even if
they should not be displayed.
(Both on Android and iOS we should presumably use these system-specific
ephemeral scroll indicator thingies that show up only during scrolling but
otherwise fade away. Hmm, probably the VCL (or toolkit?) scrollbar code should
use platform-specific code to display those then.)
Change-Id: I1f82648561e41ae25f2427fd0fe60249c927a9a1
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/winproc.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index d4a6fa8637a7..b8f1cde4c7bc 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -2621,12 +2621,30 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/, aSalWheelMouseEvent.mnX = 0; // ??? aSalWheelMouseEvent.mnY = 0; - aSalWheelMouseEvent.mbDeltaIsPixel = sal_False; + // Note that it seems that the delta-is-pixels thing is + // not actually implemented. The field is just passed on + // but its value never tested and has no effect? + aSalWheelMouseEvent.mbDeltaIsPixel = sal_True; // First scroll vertically, then horizontally aSalWheelMouseEvent.mnDelta = (long) pScrollEvent->GetYOffset(); + + // No way to figure out correct amount of "lines" to + // scroll, and for touch devices (for which this + // SALEVENBT_EXTERNALSCROLL was introduced) we don't even + // display the scroll bars. This means that the scroll + // bars (which still exist as objects, all the scrolling + // action goes through them) apparently use some dummy + // default values for range, line size and page size + // anyway, not related to actual contents of scrolled + // window. This all is very broken. I really wish the + // delta-is-pixels feature (which would be exactly what + // one wants for touch devices) would work. + aSalWheelMouseEvent.mnScrollLines = aSalWheelMouseEvent.mnDelta; + if (aSalWheelMouseEvent.mnDelta != 0) { + aSalWheelMouseEvent.mnNotchDelta = (aSalWheelMouseEvent.mnDelta < 0) ? -1 : 1; aSalWheelMouseEvent.mnCode = 0; aSalWheelMouseEvent.mbHorz = sal_False; nRet = ImplHandleWheelEvent( pWindow, aSalWheelMouseEvent ); @@ -2634,6 +2652,7 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/, aSalWheelMouseEvent.mnDelta = (long) pScrollEvent->GetXOffset(); if (aSalWheelMouseEvent.mnDelta != 0) { + aSalWheelMouseEvent.mnNotchDelta = (aSalWheelMouseEvent.mnDelta < 0) ? -1 : 1; aSalWheelMouseEvent.mnCode = 0; aSalWheelMouseEvent.mbHorz = sal_True; nRet = ImplHandleWheelEvent( pWindow, aSalWheelMouseEvent ); |