From 5f9bf787ef093e915fefca65e7b445a40d8642de Mon Sep 17 00:00:00 2001 From: AmirHossein Abdolmotallebi Date: Thu, 5 Dec 2024 03:17:45 +0330 Subject: [PATCH] fix resize handles have wrong direction in RTL languages --- .../kotlin/com/abdownloadmanager/desktop/ui/widget/Handle.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/ui/widget/Handle.kt b/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/ui/widget/Handle.kt index 2f73546..464b031 100644 --- a/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/ui/widget/Handle.kt +++ b/desktop/app/src/main/kotlin/com/abdownloadmanager/desktop/ui/widget/Handle.kt @@ -22,7 +22,9 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.pointer.PointerIcon import androidx.compose.ui.input.pointer.pointerHoverIcon import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.LayoutDirection import org.jetbrains.skiko.Cursor @Composable @@ -78,9 +80,12 @@ fun Modifier.resizeHandle( latestOnDrag(it.toDp()) } } + val isRtl = LocalLayoutDirection.current == LayoutDirection.Rtl + val reverseDirection = orientation == Orientation.Horizontal && isRtl draggable( state = draggableState, orientation = orientation, interactionSource = interactionSource, + reverseDirection = reverseDirection ) } \ No newline at end of file