From e44c332265ae87c5abf51c4ce3e1c28ac0e0d6cc Mon Sep 17 00:00:00 2001 From: Elie G Date: Tue, 10 Dec 2024 05:52:30 +0200 Subject: [PATCH] Add layout direction handling to LazyTreeIcons defaults 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. --- .../intui/standalone/styling/IntUiLazyTreeStyling.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLazyTreeStyling.kt b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLazyTreeStyling.kt index 6db8a277c..8dbbd8a7c 100644 --- a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLazyTreeStyling.kt +++ b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLazyTreeStyling.kt @@ -104,10 +104,11 @@ public fun LazyTreeIcons.Companion.defaults( chevronSelectedExpanded: IconKey = chevronExpanded, ): LazyTreeIcons { val layoutDirection = LocalLayoutDirection.current - val chevronCollapsed = if (layoutDirection == LayoutDirection.Ltr) { - AllIconsKeys.General.ChevronRight - } else { - AllIconsKeys.General.ChevronLeft - } + val chevronCollapsed = + if (layoutDirection == LayoutDirection.Ltr) { + AllIconsKeys.General.ChevronRight + } else { + AllIconsKeys.General.ChevronLeft + } return LazyTreeIcons(chevronCollapsed, chevronExpanded, chevronCollapsed, chevronSelectedExpanded) }