stackotter / swift-cross-ui

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

[AppKitBackend] Only show ScrollView scrollbar when a scrollbar is required #88

Open stackotter opened 7 months ago

stackotter commented 7 months ago

To copy the behaviour of SwiftUI (which I like in this case), we should only show a ScrollView's scrollbar is the ScrollView's content is actually big enough for scrolling to be possible.

Additionally, I reckon we should use the sleek version of the macOS scroll bar even if a mouse is plugged in. It looks so much less clunky and SwiftUI does it so it's probably not too bad for accessibility. I'm not so set on this second part though, if someone has a good reason it I'm happy for us to stick with the bigger scrollbar when a mouse is present.