mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
fix(ui): the portrait bottom bar follows the sidebar labels setting (#2558)
This commit is contained in:
1 parent
83de0e7f8c
commit
c57cc33125
2 files changed
+19
-1
No files matched your search
@@ -105,13 +105,16 @@ internal fun BottomBar(
|
||||
val bounds = remember { androidx.compose.runtime.mutableStateMapOf<String, androidx.compose.ui.geometry.Rect>() }
|
||||
val tint = androidx.compose.runtime.rememberUpdatedState(LocalPalette.current.signal)
|
||||
val content = remember { arrayOfNulls<LayoutCoordinates>(1) }
|
||||
val barContext = LocalContext.current
|
||||
remember { RailLabels.load(barContext) }
|
||||
val iconOnly = !RailLabels.shown
|
||||
Row(modifier.fillMaxWidth().background(MaterialTheme.colorScheme.surface), verticalAlignment = Alignment.CenterVertically) {
|
||||
BoxWithConstraints(Modifier.weight(1f)) {
|
||||
val itemWidth = (maxWidth / keys.size).coerceIn(56.dp, 88.dp)
|
||||
Box(Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()).onPlaced { content[0] = it }) {
|
||||
if (shown in keys) ChipGlide(keys.indexOf(shown), bounds[shown], tint, GlideAxis.Horizontal, corner = 14.dp, fill = 0.14f, outline = 0f)
|
||||
Row(Modifier.selectableGroup().padding(vertical = 4.dp), horizontalArrangement = Arrangement.Center) {
|
||||
NavigationItems(s, shown, compact = true, iconOnly = false, height = 56.dp, width = itemWidth,
|
||||
NavigationItems(s, shown, compact = true, iconOnly = iconOnly, height = if (iconOnly) 48.dp else 56.dp, width = itemWidth,
|
||||
place = { key -> Modifier.onGloballyPositioned { item -> content[0]?.let { bounds[key] = it.localBoundingBoxOf(item) }; Hops.railBounds[key] = item.boundsInRoot() } },
|
||||
onSelect = onSelect, onFocusSelect = onFocusSelect)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user