Review Request: Minor cleanups and improvements in the KineticScrolling

Marco Martin notmart at gmail.com
Sun Mar 14 19:00:41 CET 2010


On Sun, Mar 14, 2010 at 4:43 PM, Zack Rusin <zack at kde.org> wrote:
> On Sunday 14 March 2010 08:53:10 Marco Martin wrote:
>>  :/ About put things on kineticscrolling or scrollwidget, i know putting
>>  everything in kinetikscrolling makes the code a bit more wonky, but i
>>  would like it to be there to recycle it for WebView (and possibly other
>>  wdgets someday too) as much effortless as possible.
>
> This approach just won't work very well. The main issue is that it only works
> for single items with no children. If you put an item that has child items on
> the thing you won't be able to filter the events making the entire
> KineticScrolling class useless. From the ScrollWidget one can do
> setFiltersChildEvents which deals with exactly this scenario.
> This is going to be /especially/ visible on the webview since from Qt 4.7 when
> dealing with CSS animation QtWebKit uses child items to accelerate it, so
> starting Qt 4.7 flicking on web pages will be impossible.
>
> Also to be honest I don't see the appeal of exporting code that really belongs
> in a ScrollWidget to another class to make other widgets that don't inherit
> use ScrollWidget act like ScrollWidgets. They simply should use/be
> ScrollWidgets. Plus it makes Plasma a lot harder to understand when objects
> from beyond the hierarchy always filter coming in events.

ok, i see.
what i'm concerned now is that ScrollWidget and WebView would have
copies of nearly the same implementation...
Probably ScrollWidget should have been something more abstract than
the "big widget scrolls into the smaller parent" that is now, case
that would just be a subclass...
but right now is a bit late for binary compatibility...
kineticscrolling can be killed without any problem, there would just
be two more deprecated methods in the Animator class :)

WebView to remain compatible now -contains- a qgraphicswebview, so it
would be a qgraphicswebview subclass that supports flicking, it would
have the same logic of ScrollWidget, but not much more in common...

Cheers,
Marco Martin


More information about the Plasma-devel mailing list