I don't understand the step size of the fast table scroll bar.
What does container bottom have to do with delta & pageDelta? recalculateVerticalScrollBar | interval delta pageDelta visibleRows numberOfRows | self hasDataSource ifFalse: [ ^ self ]. self recalculateVerticalScrollBarVisibilityIfHidden: [ ^ self ]. visibleRows := self container calculateExactVisibleRows. numberOfRows := self dataSource numberOfRows. interval := (visibleRows / numberOfRows) asFloat. delta := 1/(self container bottom). pageDelta := (self innerBounds height - 10) / (self container bottom). self verticalScrollBar scrollDelta: delta pageDelta: pageDelta; interval: interval |
no idea :)
in fact, I was trying to fix that right now (scroll bars are not working well in FT, yet). most of this I took it from older list implementation and I’m not quitte sure how they work. I think a better implementation would be: recalculateVerticalScrollBar | interval delta pageDelta visibleRows numberOfRows | self hasDataSource ifFalse: [ ^ self ]. self recalculateVerticalScrollBarVisibilityIfHidden: [ ^ self ]. visibleRows := self container calculateExactVisibleRows. numberOfRows := self dataSource numberOfRows. interval := (visibleRows / numberOfRows) asFloat. delta := 1/visibleRows. pageDelta := (self innerBounds height - 10) / visibleRows. self verticalScrollBar scrollDelta: delta pageDelta: pageDelta; interval: interval but it still does not feels “good”. Any help here is welcome :) Esteban > On 07 Jul 2015, at 16:41, Stephan Eggermont <[hidden email]> wrote: > > I don't understand the step size of the fast table scroll bar. > What does container bottom have to do with delta & pageDelta? > > recalculateVerticalScrollBar > | interval delta pageDelta visibleRows numberOfRows | > > self hasDataSource ifFalse: [ ^ self ]. > > self recalculateVerticalScrollBarVisibilityIfHidden: [ ^ self ]. > > visibleRows := self container calculateExactVisibleRows. > numberOfRows := self dataSource numberOfRows. > interval := (visibleRows / numberOfRows) asFloat. > delta := 1/(self container bottom). > pageDelta := (self innerBounds height - 10) / (self container bottom). > self verticalScrollBar > scrollDelta: delta pageDelta: pageDelta; > interval: interval > > |
oops… bad paste. I meant this:
recalculateVerticalScrollBar | interval delta pageDelta visibleRows numberOfRows | self hasDataSource ifFalse: [ ^ self ]. self recalculateVerticalScrollBarVisibilityIfHidden: [ ^ self ]. visibleRows := self container calculateExactVisibleRows. numberOfRows := self dataSource numberOfRows. interval := (visibleRows / numberOfRows) asFloat. delta := 1/visibleRows. pageDelta := visibleRows. self verticalScrollBar scrollDelta: delta pageDelta: pageDelta; interval: interval > On 07 Jul 2015, at 16:58, Esteban Lorenzano <[hidden email]> wrote: > > no idea :) > in fact, I was trying to fix that right now (scroll bars are not working well in FT, yet). > most of this I took it from older list implementation and I’m not quitte sure how they work. > > I think a better implementation would be: > > recalculateVerticalScrollBar > | interval delta pageDelta visibleRows numberOfRows | > > self hasDataSource ifFalse: [ ^ self ]. > > self recalculateVerticalScrollBarVisibilityIfHidden: [ ^ self ]. > > visibleRows := self container calculateExactVisibleRows. > numberOfRows := self dataSource numberOfRows. > interval := (visibleRows / numberOfRows) asFloat. > delta := 1/visibleRows. > pageDelta := (self innerBounds height - 10) / visibleRows. > self verticalScrollBar > scrollDelta: delta pageDelta: pageDelta; > interval: interval > > > but it still does not feels “good”. > Any help here is welcome :) > > Esteban > > >> On 07 Jul 2015, at 16:41, Stephan Eggermont <[hidden email]> wrote: >> >> I don't understand the step size of the fast table scroll bar. >> What does container bottom have to do with delta & pageDelta? >> >> recalculateVerticalScrollBar >> | interval delta pageDelta visibleRows numberOfRows | >> >> self hasDataSource ifFalse: [ ^ self ]. >> >> self recalculateVerticalScrollBarVisibilityIfHidden: [ ^ self ]. >> >> visibleRows := self container calculateExactVisibleRows. >> numberOfRows := self dataSource numberOfRows. >> interval := (visibleRows / numberOfRows) asFloat. >> delta := 1/(self container bottom). >> pageDelta := (self innerBounds height - 10) / (self container bottom). >> self verticalScrollBar >> scrollDelta: delta pageDelta: pageDelta; >> interval: interval >> >> > |
Something like
visibleRows := self container calculateExactVisibleRows. numberOfRows := self dataSource numberOfRows. interval := (visibleRows / numberOfRows) asFloat. delta := 1/numberOfRows. pageDelta := ((visibleRows-1) floor)*delta. self verticalScrollBar scrollDelta: delta pageDelta: pageDelta; interval: interval pagedelta is still off first time. Stephan |
yes, it feels a lot better now :)
thanks! > On 07 Jul 2015, at 17:43, Stephan Eggermont <[hidden email]> wrote: > > Something like > > visibleRows := self container calculateExactVisibleRows. > numberOfRows := self dataSource numberOfRows. > interval := (visibleRows / numberOfRows) asFloat. > delta := 1/numberOfRows. > pageDelta := ((visibleRows-1) floor)*delta. > self verticalScrollBar > scrollDelta: delta pageDelta: pageDelta; > interval: interval > > pagedelta is still off first time. > > Stephan > > |
On 07-07-15 17:49, Esteban Lorenzano wrote:
> yes, it feels a lot better now :) Yeah, even though it scrolls a lot slower now :) > thanks! Happy to help. Stephan |
Free forum by Nabble | Edit this page |