fyne-x icon indicating copy to clipboard operation
fyne-x copied to clipboard

Propose utils package

Open metal3d opened this issue 2 years ago • 8 comments

metal3d avatar May 23 '22 18:05 metal3d

Are there any more wrappers that would make sense to be added? The most simple that I can think of is https://github.com/fyne-io/fyne/blob/v2.1.4/canvasobject.go#L96 (no requirement, just getting the idea out there). Focusable and draggable are likely the ones that would the most useful but they are a lot more complex.

Jacalz avatar May 23 '22 19:05 Jacalz

Doesn't Go tell us to avoid generic utils package? Great ideas here but not sure about this naming as it doesn't convey what the types internally will do / be.

andydotxyz avatar May 23 '22 20:05 andydotxyz

@Jacalz maybe drag and drop yes. I can try to add this. Focusable is maybe a bit weird on, e.g., images…

@andydotxyz Yes, “utils” is a bad idea, maybe “addons” or “adapters”, or... “extends”... Any idea ?

metal3d avatar May 24 '22 14:05 metal3d

How about “wrappers”?

Jacalz avatar May 24 '22 16:05 Jacalz

Maybe also a simple wrapper that provide a CreateRenderer for a specified object (both of the wrapper in this PR duplicate this code and the PR with layout would also benefit from it).

Bluebugs avatar May 27 '22 22:05 Bluebugs

Also a feature to add to the Tappable wrapper, maybe having the ability to do the same animation/effect automatically as when a button get tapped would make sense (I might make that something you can enable/disable).

Bluebugs avatar May 27 '22 22:05 Bluebugs

Maybe also a simple wrapper that provide a CreateRenderer for a specified object (both of the wrapper in this PR duplicate this code and the PR with layout would also benefit from it).

Isn't this what the core widget.SimpleRenderer does?

andydotxyz avatar May 28 '22 15:05 andydotxyz

@metal3d Do you have any plans on getting this done soon? It would be a great addition to fyne-x :)

Jacalz avatar Oct 08 '22 10:10 Jacalz

I'm still not sure about the Set... naming, earlier @lucor suggested Make... instead - what do @Jacalz and @Bluebugs think (having already approved).

andydotxyz avatar Nov 19 '22 22:11 andydotxyz

Using Make instead of Set sounds good to me too. I would approve such a change.

Bluebugs avatar Nov 19 '22 23:11 Bluebugs

Changed to MakeXXX and fixed the comment import to "wrapper".

metal3d avatar Nov 21 '22 12:11 metal3d