Michael Gerz wrote:
Abdelrazak Younes schrieb:
Abdelrazak Younes wrote:
Hello,

I had an idea: if clicking in the scrollbar should behave like PageDown or PageUp, why not using the same LFUNs as the one used by the keyboard action?

This patch is doing just that ;-). It is so simple that I wonder why it has not been done before. Of course it works fine only when cursor_follows_scrollbar is set. I've tried to restore the cursor when it is not the case (in WorkAre::scrollBarAction()) but it doesn't work reliably. So I have two questions:

1) Does anyone see any shortcoming to this solution when cursor_follows_scrollbar is set? If not, I'd like to put it in.

2) Anyone knows how to restore the cursor reliably?

Actually it is restored fine. I was misleaded by the fact that cursorDown does not go back to the cursor but starts at the beginning of the screen. But this bug is also present without my patch!

So, here is the updated patch. Please test it. I think the current scrollbar behaviour presents big usability problems.
Hmmm... this patch looks too simple :-)

Comments (from someone who is NOT familiar with the code)
- You could replace the multiple "case" statements by a single "default" (a matter of taste, of course).

Some big names in the list don't like default when it can be avoided. This is the case here as we don't have many choices. Besides, some news LFUN could be used for the other values.

- scrollBarAction might be renamed, because it does not cover all scroll bar actions.

My idea is rather to extend it to the other actions.

- Is there a need to clean up scrollBufferView? It no longer handles SliderPageStepAdd and SliderPageStepSub!

scrollBufferView() is scary, I won't touch that now. The idea of this patch is to avoid it whenever we can.

Abdel.

Reply via email to