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( is TreeItem.Dir -> DirectoryEntry(
dirName = entry.displayName, dirName = entry.displayName,
isExpanded = entry.isExpanded,
onClick = { onDirectoryClick(entry) }, onClick = { onDirectoryClick(entry) },
depth = entry.depth, depth = entry.depth,
onGenerateContextMenu = { onGenerateDirectoryContextMenu(entry) }, onGenerateContextMenu = { onGenerateDirectoryContextMenu(entry) },

View File

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

View File

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