fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.92k stars 1.38k forks source link

Add Access to Table's Current Focus #5089

Open groboclown opened 1 month ago

groboclown commented 1 month ago

Checklist

Is your feature request related to a problem?

The Table widget keeps track of the current focus location, which helps with keyboard navigation. The Table keeps track of this separate from the Selected information.

By adding access to Current Focus, both reading it and a callback for when it updates, the cells can render whole row effects. For example, highlighting the row for very wide tables which otherwise would be difficult to visually distinguish.

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

No. The table stores this data as a private member, and Go prohibits access to it. The ScrollTo like functions allow limited access to write to the member, but there exists no way to read it.

Describe the solution you'd like to see.

I would like to see the Table structure to provide read access, and a callback function to signal when the value changes.

andydotxyz commented 1 month ago

If the purpose is to highlight rows to follow focus then wouldn't this be better done internally to the table instead of with new APIs?