fyne icon indicating copy to clipboard operation
fyne copied to clipboard

Method Scroll.MakeChildVisible(CanvasObject)

Open matwachich opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe:

Example: a Form inside a Scroll ; we Tab-navigate Form Entries, when we arrive at a non visible Entry, the Scroll should follow.

Is it possible to construct a solution with the existing API?

I don't think so...

Describe the solution you'd like to see:

Add a method to the Scroll container Scroll.MakeChildVisible(fyne.CanvasObject) that developper can call in Entry.OnFocusGained

matwachich avatar Jun 02 '22 20:06 matwachich

Hmm. Nice idea with focus moving the view. I wonder if that perhaps should be done automatically by the focus manager? cc @toaster

Jacalz avatar Jun 03 '22 05:06 Jacalz

@Jacalz, you mean that the focus manager should automatically detect if a (newly) focused element is inside a scroll container and adjust its scrolling accordingly? Might work.

toaster avatar Jun 03 '22 09:06 toaster

@Jacalz, you mean that the focus manager should automatically detect if a (newly) focused element is inside a scroll container and adjust its scrolling accordingly?

Indeed. That was what I had in mind. Would remove a lot of repetitive code calling the function mentioned above.

Jacalz avatar Jun 03 '22 09:06 Jacalz

Sounds cool. Though maybe ScrollToObject might fit the existing naming better

andydotxyz avatar Jun 07 '22 20:06 andydotxyz