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