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)) Spacer(modifier = Modifier.weight(1f))
MenuButton(
modifier = Modifier.padding(end = 4.dp),
title = "Fetch",
icon = painterResource("fetch.svg"),
onClick = { menuViewModel.fetchAll() },
)
ExtendedMenuButton( ExtendedMenuButton(
modifier = Modifier.padding(end = 4.dp), modifier = Modifier.padding(end = 4.dp),
title = "Pull", title = "Pull",
icon = painterResource("download.svg"), icon = painterResource("download.svg"),
onClick = { menuViewModel.pull() }, onClick = { menuViewModel.pull() },
extendedListItems = pullContextMenuItems { extendedListItems = pullContextMenuItems(
onPullRebase = {
menuViewModel.pull(true) menuViewModel.pull(true)
},
onFetchAll = {
menuViewModel.fetchAll()
} }
) )
)
ExtendedMenuButton( ExtendedMenuButton(
title = "Push", title = "Push",

View File

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