From b4c304371c6280dada7f41f24da07b0f0c65aaa8 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Thu, 27 Oct 2022 20:05:45 +0200 Subject: [PATCH] Improved menu bar --- .../kotlin/com/jetpackduba/gitnuro/ui/Menu.kt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/Menu.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/Menu.kt index 304a444..7359cef 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/Menu.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/Menu.kt @@ -92,12 +92,12 @@ fun Menu( onCreateBranch() } - MenuButton( - title = "Merge", - icon = painterResource("merge.svg"), - ) { - onCreateBranch() - } +// MenuButton( +// title = "Merge", +// icon = painterResource("merge.svg"), +// ) { +// onCreateBranch() +// } Spacer(modifier = Modifier.width(32.dp)) @@ -164,14 +164,14 @@ fun MenuButton( contentDescription = title, modifier = Modifier .size(24.dp), - tint = MaterialTheme.colors.onPrimary, + tint = MaterialTheme.colors.onBackground, ) Text( text = title, style = MaterialTheme.typography.caption, maxLines = 1, textAlign = TextAlign.Center, - color = MaterialTheme.colors.onPrimary, + color = MaterialTheme.colors.onBackground, ) } } @@ -193,6 +193,9 @@ fun ExtendedMenuButton( .ignoreKeyEvents() .clip(RoundedCornerShape(4.dp)) .background(MaterialTheme.colors.surface) + .handMouseClickable { + showDropDownMenu = true + } ) { Column( modifier = Modifier @@ -207,12 +210,12 @@ fun ExtendedMenuButton( contentDescription = title, modifier = Modifier .size(24.dp), - tint = MaterialTheme.colors.onPrimary, + tint = MaterialTheme.colors.onBackground, ) Text( text = title, style = MaterialTheme.typography.caption, - color = MaterialTheme.colors.onPrimary, + color = MaterialTheme.colors.onBackground, maxLines = 1, ) } @@ -220,17 +223,14 @@ fun ExtendedMenuButton( Box( modifier = Modifier .fillMaxHeight() - .ignoreKeyEvents() - .handMouseClickable { - showDropDownMenu = true - }, + .ignoreKeyEvents(), contentAlignment = Alignment.Center, ) { Icon( painterResource("expand_more.svg"), contentDescription = null, - tint = MaterialTheme.colors.onPrimary, + tint = MaterialTheme.colors.onBackground, modifier = Modifier.size(16.dp) )