From e66c9a6ef41dd25388efffc0be9fa15003097145 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:37:01 +0200 Subject: [PATCH] Don't eat the first app shortcut Close #906 --- .../ui/launcher/search/apps/AppItem.kt | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/apps/AppItem.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/apps/AppItem.kt index c0eaf5be..5ce06f11 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/apps/AppItem.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/search/apps/AppItem.kt @@ -305,46 +305,47 @@ fun AppItem( }.collectAsState(null) if (i > 0) { HorizontalDivider() - Row( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier - .clickable { - viewModel.launchChild(context, shortcut) - } - .padding(vertical = 4.dp) - ) { - ShapedLauncherIcon( - size = 32.dp, - icon = { icon }, - shape = CircleShape, - modifier = Modifier - .padding(horizontal = 12.dp) - .size(32.dp), - ) - - Text( - shortcut.labelOverride ?: shortcut.label, - modifier = Modifier.weight(1f), - style = MaterialTheme.typography.titleSmall, - maxLines = 1, - overflow = TextOverflow.Ellipsis - ) - IconButton( - onClick = { - if (isPinned) { - viewModel.unpinChild(shortcut) - } else { - viewModel.pinChild(shortcut) - } - } - ) { - Icon( - if (isPinned) Icons.Rounded.Star else Icons.Rounded.StarOutline, - null - ) + } + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier + .clickable { + viewModel.launchChild(context, shortcut) } + .padding(vertical = 4.dp) + ) { + ShapedLauncherIcon( + size = 32.dp, + icon = { icon }, + shape = CircleShape, + modifier = Modifier + .padding(horizontal = 12.dp) + .size(32.dp), + ) + + Text( + shortcut.labelOverride ?: shortcut.label, + modifier = Modifier.weight(1f), + style = MaterialTheme.typography.titleSmall, + maxLines = 1, + overflow = TextOverflow.Ellipsis + ) + IconButton( + onClick = { + if (isPinned) { + viewModel.unpinChild(shortcut) + } else { + viewModel.pinChild(shortcut) + } + } + ) { + Icon( + if (isPinned) Icons.Rounded.Star else Icons.Rounded.StarOutline, + null + ) } } + } } }