-
Notifications
You must be signed in to change notification settings - Fork 43
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 RTL Support for Chevron Icons in LazyTreeIcons Defaults #721
Conversation
The function now adjusts the chevronCollapsed icon according to the current layout direction, supporting both Left-to-Right and Right-to-Left orientations. This ensures the icons correctly reflect the visual directionality context, enhancing user interface consistency.
Thanks @kdroidFilter — looks like the CI is not passing. Can you run the check task locally and fix the issues it finds? Thanks! |
@rock3r Ok, I'm trying to do this tonight |
Much appreciated, thanks! |
Updated the `defaults` function in `IntUiLazyTreeStyling` to include `Composer` parameters and adjusted its implementation. Improved code readability by reformatting the `chevronCollapsed` initialization block.
Thanks for updating the PR. I've looked at the change, and I am torn on it — for these reasons:
As a result, I'm leaning towards not taking this in. @hamen what do you think? |
@rock3r I understand that the goal is to avoid making styles composable. My intention was simply to ensure that the icons adapt dynamically to the RTL context. I must admit that I didn’t realize the theme was exclusively intended for use in IDEs. I thought it was also designed for building desktop applications more generally. Apologies for the inconvenience caused by this misunderstanding. |
I understand that, but my advice would be to do it in your client code if you need to support RTL. Something like: // At the root of your app, where you define the theme
IntUiTheme {
val treeStyle = remember(JewelTheme.isDark) {
// Construct the style with the right icon here based on your needs
}
CompositionLocalProvider(LocalLazyTreeStyle provides treeStyle) {
// Your root composable here
}
}
It is also suitable for general desktop applications, however, the design system it implements does not define RTL behaviour, and I am hesitant to implement things that don't exist in the design system nor in its Swing implementation. |
Thanks a lot ! |
As much I appreciate external contributions, right now, I would focus on providing the core tools that mirror what the IJP and Swing are doing. |
Makes sense to me. I'll close this PR then, but still want to thank you for the contribution even if it wasn't merged @kdroidFilter 🙏 |
This pull request adds support for right-to-left (RTL) layout direction in the LazyTreeIcons.Companion.defaults function of the Jewel theme for JetBrains. Previously, the chevron icons used in the tree structure did not account for layout direction, leading to incorrect icon orientation in RTL contexts. This update ensures that the chevron icons adjust dynamically based on the current layout direction.