Making kinetic scrolling generic

Marco Martin notmart at gmail.com
Fri Sep 25 19:34:08 CEST 2009


On Friday 25 September 2009, Aaron J. Seigo wrote:
> On September 25, 2009, Adenilson Cavalcanti wrote:
> > Dear friends
> >
> > Last Wednesday, there was a discussion in plasma IRC channel
> > concerning ideas to make the Kineticscrolling class more generic to
> > handle scrolling in other plasma components.
> >
> > Trying to understand how *actual* movement is done in some of
> > KDE's plasmoids, I had read the code of following plasmoids:
> >
> >
> > 1) Webview (kdelibs/plasma/widgets)
> >
> > *WebView class*
> >  - object: d->page is a QWebPage
> >  - moving: d->page->event(&we);
> >
> >  Maybe void QWebPage::scrollRequested ( int dx, int dy, const QRect &
> >  rectToScroll )   [signal] could be used or just keep with current
> > approach of generating events.
>
> there's actually some work going on right at Qt to wrap QWebView into a
> nice QGraphicsView object with all kinds of nice things (buffered rendering
> for better scrolling, etc); so i wouldn't worry tooo much about web view
> right now as we'll likely be replacing it with the QGraphicsWebView at some
> point.
>
> > Trying to address this requirements the following design is proposed:
>
> i like it, especially the use of a standard property.
>
> the only addition would be that such widgets would have to keep that
> property updated with the proper 0..1 value when the contents are scrolled
> in some other way? i assume that KineticScrolling will need this value to
> determine what to do (e.g. the overreach bounce, etc)

the bounce could be realized by letting the scroll valur be between say -0.1 
and 1.1 instead of 0-1, not really pretty, but i can't think out another way 
right now?

>
> > - KineticScrolling emits a signal in setKineticScrollValue
>
> KineticScrolling::setKineticScrollValue is perhaps a little redundant?
> would setScrollValue be enough? either way, it's not a big deal and
> shouldn't interfere with you going ahead with this design in any way.
would the properties be just in the internal KineticScroll object or also in 
the external widgets that support scroll? i would do the latter, tis way, 
kinetic would nimate KineticScroll, and them KineticScroll would call 
setProperty("scrollvalue", progress) on the scrolling widget, removing the 
need to have a setKineticScrollValue signal

-- 
Marco Martin


More information about the Plasma-devel mailing list