Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WScrollable: Add a scrollable widget type. #3890

Merged
merged 4 commits into from
Jun 1, 2021
Merged

Conversation

ywwg
Copy link
Member

@ywwg ywwg commented May 22, 2021

This allows skins to add scrollbars to areas.

Not used in any current skins, but tested with my raspi branch. It would be simple
to add support for controlling whether horizontal and/or vertical scrollbars are used,
but for now I'd like to leave it on auto. (https://martinfowler.com/bliki/Yagni.html).

@uklotzde
Copy link
Contributor

It would even be safe to add this extension to 2.3 without any risk.

@ronso0 What do you think.

@ywwg
Copy link
Member Author

ywwg commented May 23, 2021

This code has no real benefit to 2.3, since none of the skins use it. We could target 2.3.1 but I don't want to disrupt the release.

@ronso0
Copy link
Member

ronso0 commented May 23, 2021

The benefit of squeezing this into 2.3.0 is that users could develop compact skins with stable 2.3 instead of having to use unstable main/2.4 fot that = they could not just develop but also test the skins live with a stable Mixxx install.

I'm curious -- I'll build this and test the raspi skin.
Sooo as soon as there's child widget overflow in one or more directions the parent shows scrollbars to navigate the child?

@ywwg
Copy link
Member Author

ywwg commented May 25, 2021

fair! I do think this is safe so I'm ok including it. Yes, it shows scrollbars only when they are needed. We could easily add params to control this behavior even more.

@Holzhaus
Copy link
Member

Or we just use Flickable ;-)

Anyway, I have no strong opinion on this, although I think I'd rather use QML if you're building a touch UI.

@ywwg
Copy link
Member Author

ywwg commented May 27, 2021

we are a loooooong way away from QML. This is a good stop-gap with low risk and high payoff in the interim.

…crollbars to areas.

Not used in any current skins, but tested with my raspi branch. It would be simple
to add support for controlling whether horizontal and/or vertical scrollbars are used,
but for now I'd like to leave it on auto.  (https://martinfowler.com/bliki/Yagni.html).
@ywwg ywwg changed the base branch from main to 2.3 May 27, 2021 23:07
@ywwg
Copy link
Member Author

ywwg commented May 27, 2021

retargeted at 2.3

@ronso0
Copy link
Member

ronso0 commented May 29, 2021

@ywwg I think you need to rebase, builds are failing.

@ywwg
Copy link
Member Author

ywwg commented May 30, 2021

skincontext.h moved, fixed.

@ronso0
Copy link
Member

ronso0 commented May 30, 2021

@ywwg
I tried making the expanded sampler row scrollable. Unfortunately the vertical scrollbars render it unusable
image
I didn't manage to hide the vertical scrollbars by setting any SizePolicy or by wrapping in a WidgetGroup -- only a fixed size would solve the issue (which entirely defeats the purpose of an easy-to-use WWidget beause you'd need to know the height of the child and the scrollbars).

Can you add a <ScrollBar> parser to avoid the usual hazzle with SizePolicy?

@ywwg
Copy link
Member Author

ywwg commented May 30, 2021

I added HorizontalScrollBarPolicy and VerticalScrollBarPolicy to mirror the QT API

@ronso0
Copy link
Member

ronso0 commented May 31, 2021

Thanks.
unfortunately that still doesn't work as I expect: the v-scrollbar is disabled but the the h-scrollbar overlaps the child.

The use cases I see for the scrollable (for small screens only):

  • expanded sampler rows
  • effect parameter rows

To have a satisfying UX I think it is required to
1 show only the necessary scrollbars ✔️
2 resize the Scrollable to the content in the dimension the scrollbar was disabled = Scrollable grows and pushes adjacent widgets so the scrollbar doesn't overlap the content, so we can avoid the situation pictured above with the samplers

For 2 we'd probably need to override the resizeEvent() and adjust the Scrollable to the content + scrollbars depending on the scrollbar configuration. Or use sizeAdjustPolicy, idk

I stick to my previous argument that we could add this now to 2.3 and allow developing comapct skins until QML skins are ready.
So IMO we can either merge this now as is and do the tweaking in 2.3.1
Or you can improve the situation for 2.3 already.
I don't mind..

@ywwg
Copy link
Member Author

ywwg commented Jun 1, 2021

Yeah I think it's ok to merge with these bugs and iterate to fix the issues as we actually start to use it. It'll all be simple passthroughs from XML to QT.

@ronso0
Copy link
Member

ronso0 commented Jun 1, 2021

Alright, let's go then. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants