[Subsurface-trac] [Subsurface] #176: Cannot scroll in dive notes using scroll wheel

Lubomir I. Ivanov neolit123 at gmail.com
Fri Dec 13 13:43:29 UTC 2013


On 13 December 2013 21:49, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 13 December 2013 20:02, Linus Torvalds <torvalds at linux-foundation.org> wrote:
>> On Fri, Dec 13, 2013 at 9:44 AM, Linus Torvalds
>> <torvalds at linux-foundation.org> wrote:
>>> On Fri, Dec 13, 2013 at 4:14 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>>>>
>>>> i think i just addressed this one in:
>>>> [PATCH] MainTab: tweak the scrolling while inside the notes
>>>>
>>>> linus, could you or someone else give it a try?
>>>
>>> I don't think it's necessarily wrong, but it doesn'tt *matter*.
>>
>> Actually, I take that back. It does matter, and I think it makes the
>> scroll-wheel behavior worse.
>>
>> So the way I expect my scroll-wheel to work is that if I'm in a
>> scrollable region, it scrolls that region first - and then when it
>> hits the end of the region, it starts scrolling the "next" scrollable
>> frame or window. That's how it works pretty much everywhere else.
>>
>> And your "tweak the scrolling while inside the notes" actually stops
>> scrolling the whole "Dive Notes" window, if the "Notes" section is
>> selected. Which isn't what I expect (or what other applications do).
>>
>> So the only thing I really _don't_ expect is that it starts editing
>> things as it scrolls past them. Yes, people edit things with the
>> scroll-wheel too (say, you have a drop-down choice thing, and want to
>> scroll through it), but that happens only after you've opened the
>> drop-down thing explicitly, not because you happen to scroll past the
>> drop-down entry in a window.
>>
>
> ok, think i can try making a quick fix for that i.e. disable the value
> changes if "edit mode" is not "on" - this looks like a bug actually.
> and also make the values change only if a filed is selected (e.g.
> date/time), but have to test that a little.
>
> scrolling up from the notes will remain as it is (without my patch)
> it pretty much scrolls the whole widget if done scrolling up from the notes.
> seems to be the standard scroll behavior in Qt.
>

actually this seems complicated and i'm going to ask tomaz or someone
who has ideas for help.

the problem is the following - i like to disable wheel actions in a
field (in MainTab) until the field is actually *clicked* and ("edit
mode" is entered). this prevents a bug discussed above that while
"edit mode" is not enabled, the user can change dates with the wheel
over it!

now, i can do a quick fix for that with in eventFilter():
if (editMode == NONE && event->type() == QEvent::Wheel)
    return true;

but there are still problems!
what happens is that even if i tell the "event filter" to override the
wheel (return true) if edit mode is not enabled, a field (such as
date/time) still receives focus and then it's not possible to enter
"edit mode" if this same field is clicked again...doh.

basically the idea that linus proposes is to prevent focus on fields
from mouse wheel actions while not editing (e.g. changing the date),
but still possibly allow scrolling of the scrollArea in the maintab
with the wheel, while not editing.
hope that makes sense.

i can try looking into this further, by doing more research but ideas
are appreciated, because i simply don't know how to change that
particular behaviour without using setEnabled(false).
lubomir
--


More information about the subsurface mailing list