-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scrollbar style and behavior reactive update for Mac OS #535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm this does not cause issues on Win/Linux? You specifically didn't check those boxes, and I'd like to be sure :)
ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/SwingBridgeService.kt
Show resolved
Hide resolved
ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/ScrollbarBridge.kt
Show resolved
Hide resolved
@hamen re:
Can you confirm it doesn't cause issues for Windows and Linux? |
Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
Description
This PR adds
MacScrollbarHelper
. This file is heavily inspired by IntelliJNSScrollerHelper
. It has been converted to Kotlin, purged of what we don't need and migrated to Kotlin Coroutines.MacScrollbarHelper
API provides:scrollbarVisibilityStyleFlow: StateFlow<ScrollbarVisibility>
trackClickBehaviorFlow: StateFlow<TrackClickBehavior>
trackClickBehavior: TrackClickBehavior
scrollbarVisibility: ScrollbarVisibility
The two flows have been plugged into the
SwingBridgeService.currentBridgeThemeData: StateFlow<BridgeThemeData>
. Every time the theme, the scrollbar visibility, or the track behavior change, we get an emission and whoever is listening gets an update.The two properties replaced the original implementations we had in
ScrollbarBridge
.Furthermore, this PR iterate once again on scrollbars colors on macOS.
Related Issues
#510 #445
Checklist
Pre-push
Gradle taskHow Has This Been Tested?
Screenshots or GIFs: