forked from omni/OmniCards
fix: disabled changing position when cards searching
This commit is contained in:
@@ -186,7 +186,7 @@ fun TopBar(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: @Composable () -> Unit) {
|
||||
fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: (@Composable () -> Unit)? = null) {
|
||||
val context = LocalContext.current
|
||||
|
||||
var menuExpanded by remember { mutableStateOf(false) }
|
||||
@@ -244,9 +244,11 @@ fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: @Co
|
||||
)
|
||||
}
|
||||
|
||||
if (reorderIcon != null) {
|
||||
reorderIcon()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DropdownMenu(
|
||||
expanded = menuExpanded,
|
||||
|
||||
@@ -234,9 +234,9 @@ fun MainPage(
|
||||
.fillMaxWidth()
|
||||
.alpha(if (isDragging) 0.7f else 1f)
|
||||
) {
|
||||
CardButton(
|
||||
card,
|
||||
onDeleteCard,
|
||||
var reorderIcon: (@Composable () -> Unit)? = null
|
||||
|
||||
if (queryCleaned.isEmpty()) {
|
||||
reorderIcon = {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.DragHandle,
|
||||
@@ -251,6 +251,12 @@ fun MainPage(
|
||||
.padding(8.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
CardButton(
|
||||
card,
|
||||
onDeleteCard,
|
||||
reorderIcon
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user