Fixed expanded folder icon not showing up

This commit is contained in:
Abdelilah El Aissaoui 2024-03-01 15:21:12 +01:00
parent 82aad6a6b0
commit e135ec133c
No known key found for this signature in database
GPG Key ID: 7587FC860F594869
3 changed files with 7 additions and 4 deletions

View File

@ -453,6 +453,7 @@ private fun CommitTreeItemEntry(
is TreeItem.Dir -> DirectoryEntry(
dirName = entry.displayName,
isExpanded = entry.isExpanded,
onClick = { onDirectoryClick(entry) },
depth = entry.depth,
onGenerateContextMenu = { onGenerateDirectoryContextMenu(entry) },

View File

@ -1124,8 +1124,9 @@ private fun UncommittedTreeItemEntry(
)
is TreeItem.Dir -> DirectoryEntry(
entry.displayName,
onClick,
dirName = entry.displayName,
isExpanded = entry.isExpanded,
onClick = onClick,
depth = entry.depth,
onGenerateContextMenu = { onGenerateDirectoryContextMenu(entry) },
)

View File

@ -141,13 +141,14 @@ fun FileEntry(
@Composable
fun DirectoryEntry(
dirName: String,
onClick: () -> Unit,
isExpanded: Boolean,
depth: Int = 0,
onClick: () -> Unit,
onGenerateContextMenu: () -> List<ContextMenuElement>,
) {
FileEntry(
icon = painterResource(AppIcons.FOLDER),
icon = painterResource(if (isExpanded) AppIcons.FOLDER_OPEN else AppIcons.FOLDER),
iconColor = MaterialTheme.colors.onBackground,
isSelected = false,
onClick = onClick,