Skip to content

PC3 ScrollView: Fix ScrollBar.active property

ivan tkachenko requested to merge work/ratijas/scrollbar into master

First, ScrollView, ScrollBar attached property and built-in Qt themes are not really designed to handle nullable scrollbars. So we don't care to support such cases either. There is a well-documented way to hide a particular scrollbar: policy: ScrollBar.AlwaysOff.

Second, it was a careless typo or a mistake to bind scrollbars' active property to themselves. Instead they should bind to each other, so that they show up and disappear simultaneously on hover.

Bonus parts:

PC3 ScrollView: Remove id from a scrollbar

This id is never used anywhere, but it prevents QML engine from ignoring (not instantiating) this component when a client code overrides this ScrollBar.vertical property with another component.

PC3 ScrollView: Drop support for nullable ScrollBars

As previously described, QQC2 is not well-designed to handle null scrollbars, so we shouldn't care about them being null.

PC3 ScrollView: Move contentItem clipping hack into a Binding component

Because what the heck is that property doing inside a ScrollBar… If a client code changes that scrollbar to a custom one, then it would automatically lose the clipping too. That's an unacceptable side-effect.

Edited by ivan tkachenko

Merge request reports