Closed demarey closed 4 years ago
yes, I agree with that design
Sorry for coming late to this, I was in meetings all morning. I chatted a bit with Christophe, he sumarized well our discussion.
Another possibility is that users that want to scroll to selection should do manually. This would avoid adding new API, for something that is already doable.
self selectIndex: anInteger.
self verticalAlignment desiredVisibleRow: anInteger.
I think it's important also to understand what desiredVisibleRow:
is (for users, and even if somebody wants to replace it by another mechanism). desiredVisibleRow:
is a hint to tell that we would like a particular row to be visible or not in the screen. It's up to the backend to implement how to react to that (even if it could be ignoring).
The morphic backend uses FTTable scrolling, and behaves as follows as of Pharo8:
For more info, there are some tests in here:
In GTK (probably this is already done 😄, but just for completeness) this could be implemented using https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-scroll-to-cell
Learning from the GTK approach, scrolling could be extended with an alignment property too... But that becomes a feature request, since it could impact all backends :))
I'll make a PR with some comments on desiredVisibleRow:
.
You can see an example of this strange behaviour here: https://github.com/pharo-project/pharo-launcher/issues/444 This behavior was introduced in https://github.com/pharo-spec/Spec/pull/838.
Here is a small script you can use to reproduce:
I discussed with @guillep of this issue. Here is a short summary:
presenter verticalAlignment desiredVisibleRow: index
insteadNow a design question is: should selection scroll?
@guillep proposes to add this method to the presenter:
@estebanlm @StevenCostiou @tesonep your opinion?