Skip to content

Commit

Permalink
Add layout direction handling to LazyTreeIcons defaults
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kdroidFilter committed Dec 10, 2024
1 parent a735e98 commit e44c332
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit e44c332

Please sign in to comment.