stackotter / swift-cross-ui

A cross-platform declarative UI framework, inspired by SwiftUI.
https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/
MIT License
652 stars 36 forks source link

Table? #53

Closed mikekreuzer closed 1 year ago

mikekreuzer commented 1 year ago

I know it's a big ask, but are tables in scope for this project?

Cheers.

stackotter commented 1 year ago

Yeah that'd be great to have. I'll add it to the todos. Shouldn't be too difficult to implement (although some backends probably won't support it). Looks like we should be able to just use GtkTable for the gtk backend and QTableWidget for the Qt backend.

mikekreuzer commented 1 year ago

That is awesome news, thank you.

stackotter commented 1 year ago

Got around to starting on the table implementation tonight. Here's what I've got so far: https://twitter.com/stackotter/status/1712114864603447804?s=21&t=8mH7o3RViX0cmzrAyWK0Yg (and here's the code used to make that example)

stackotter commented 1 year ago

Are there any specific features of table that you'd be looking to use in your use case? (e.g. sorting, styling spacing, etc)

mikekreuzer commented 1 year ago

I ended up writing the thing I originally wanted this for in Kotlin/Compose Multiplatform - I'm sure there'll be other Swift things in the future, but not for a while.

The main lesson I learnt about tables in that process was that going in I thought I needed it all, sorting, etc, all out of the box. But I didn't. Compose on desktop doesn't have any of that stuff as far as I can tell, & it worked out just fine with the plainest of plain vanilla tables. The only thing they're lacking that hurts is in accessibility, will drop it long term if they don't fix that, but the other stuff, meh. For me.

stackotter commented 1 year ago

The main lesson I learnt about tables in that process was that going in I thought I needed it all, sorting, etc, all out of the box. But I didn't.

Ok that’s good to know!

I ended up writing the thing I originally wanted this for in Kotlin/Compose Multiplatform - I'm sure there'll be other Swift things in the future, but not for a while.

Yeah all good, Kotlin is definitely more stable cause it’s not just a guy in his free time 😅 But I hope that soon I’ll be able to spend a good chunk of time making it a pretty viable option for most apps.

stackotter commented 1 year ago

I'll close this now since a basic Table view has been implemented. Further refinements of Table can be opened as separate issues if anyone ever wants them before they get implemented.