Moved fetch button back to dropdown

This commit is contained in:
Abdelilah El Aissaoui 2022-10-27 20:57:35 +02:00
parent 31d5a98f2e
commit 31712cd846
2 changed files with 13 additions and 10 deletions

View File

@ -51,22 +51,20 @@ fun Menu(
Spacer(modifier = Modifier.weight(1f))
MenuButton(
modifier = Modifier.padding(end = 4.dp),
title = "Fetch",
icon = painterResource("fetch.svg"),
onClick = { menuViewModel.fetchAll() },
)
ExtendedMenuButton(
modifier = Modifier.padding(end = 4.dp),
title = "Pull",
icon = painterResource("download.svg"),
onClick = { menuViewModel.pull() },
extendedListItems = pullContextMenuItems {
extendedListItems = pullContextMenuItems(
onPullRebase = {
menuViewModel.pull(true)
},
onFetchAll = {
menuViewModel.fetchAll()
}
)
)
ExtendedMenuButton(
title = "Push",

View File

@ -4,11 +4,16 @@ import androidx.compose.foundation.ExperimentalFoundationApi
fun pullContextMenuItems(
onPullRebase: () -> Unit,
onFetchAll: () -> Unit,
): List<DropDownContentData> {
return mutableListOf(
DropDownContentData(
label = "Pull with rebase",
onClick = onPullRebase,
),
DropDownContentData(
label = "Fetch all",
onClick = onFetchAll,
),
)
}