diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt index bbdd861c9d..7df5ca2bbc 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.kt @@ -187,14 +187,14 @@ private fun ActiveUserSection( } @Composable -fun UserPickerInactiveUserBadge(userInfo: UserInfo, stopped: Boolean, onClick: (user: User) -> Unit) { +fun UserPickerInactiveUserBadge(userInfo: UserInfo, stopped: Boolean, size: Int = 60, onClick: (user: User) -> Unit) { Box { IconButton( onClick = { onClick(userInfo.user) }, enabled = !stopped ) { Box { - ProfileImage(size = 60.dp, image = userInfo.user.profile.image, color = MaterialTheme.colors.secondaryVariant) + ProfileImage(size = size.dp, image = userInfo.user.profile.image, color = MaterialTheme.colors.secondaryVariant) if (userInfo.unreadCount > 0) { unreadBadge() } diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.desktop.kt index 8cc23b26c7..636fddbd24 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/views/chatlist/UserPicker.desktop.kt @@ -1,8 +1,18 @@ package chat.simplex.common.views.chatlist +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.lazy.grid.* +import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp import chat.simplex.common.model.User import chat.simplex.common.model.UserInfo +import chat.simplex.common.platform.ColumnWithScrollBar +import chat.simplex.common.platform.LazyColumnWithScrollBar +import chat.simplex.common.ui.theme.DEFAULT_PADDING +import chat.simplex.common.ui.theme.DEFAULT_PADDING_HALF import chat.simplex.res.MR import dev.icerock.moko.resources.compose.painterResource import dev.icerock.moko.resources.compose.stringResource @@ -14,6 +24,27 @@ actual fun UserPickerInactiveUsersSection( onShowAllProfilesClicked: () -> Unit, onUserClicked: (user: User) -> Unit, ) { + if (users.isNotEmpty()) { + val userRows = users.chunked(5) + val rowsToDisplay = if (userRows.count() > 2) 2 else userRows.count() + + Column(Modifier.padding(horizontal = DEFAULT_PADDING).height((55.dp + DEFAULT_PADDING) * rowsToDisplay)) { + ColumnWithScrollBar(verticalArrangement = Arrangement.spacedBy(DEFAULT_PADDING)) { + userRows.forEach { row -> + Row( + horizontalArrangement = Arrangement.spacedBy(18.dp), + ) { + row.forEach { u -> + UserPickerInactiveUserBadge(u, stopped, size = 55) { + onUserClicked(u.user) + } + } + } + } + } + } + } + UserPickerOptionRow( painterResource(MR.images.ic_manage_accounts), stringResource(MR.strings.your_chat_profiles),