Vertical scroll to parent

#1

I’ve got a viewport inside a viewport. The inner viewport i want to respond to horizontal scroll events but if a vertical scroll happens i want to scroll the outer one.

At the moment if the mouse is over the inner viewport it scrolls horizontally whether i drag vertically or horizontally on the trackpad.

It’s rows of album covers, a bit like netflix…

Any ideas?

0 Likes

#2

Is this a hard question or just incomprehensible? :slight_smile:

0 Likes

#3

Do you have the correct setScrollBarsShown config for each Viewport?

0 Likes

#4

The inner one is correct: I’ve disabled all the vertical scrolling options.

0 Likes

#5

I’m not sure what the answer is. I had a similar setup with a Midi editor, with an inner Viewport with vertical scrolling for Midi notes, and the outer Viewport with horizontal scrolling for time, and I don’t recall having any issues… I’ll try to go back and look at the code…

0 Likes

#6

Thanks! Interesting if it worked for you. Unless its’ a new JUCE thing, we are on some older build, I’ll check the JUCE commits…

0 Likes

#7

Looking back, the horizontal (time) viewport was inside the vertical (note) viewport. And here are the setScrollBarsShown lines:

midiEditorVerticalViewport->setScrollBarsShown (true, false, true, false);

midiEditorTimeViewport->setScrollBarsShown (false, false, false, true);
0 Likes

#8

Well if it worked for you that’s good news :slight_smile: I’ll go digging.

0 Likes