mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
fix(ui): the wall's fades stay at the pane's size while the wall sinks
This commit is contained in:
1 parent
1e291dfdf4
commit
42b3127486
3 files changed
+12
-9
No files matched your search
@@ -137,10 +137,8 @@ internal fun DesktopPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
|
||||
onOpen = { scope.launch { scroll.animateScrollTo(0) }; a.onDesktopSettings() },
|
||||
onPrimary = a.onDesktop, downOpens = false, onOpenChange = { sheetOpen = it },
|
||||
start = if (narrow) 20.dp else 44.dp, bottom = if (narrow) 20.dp else 44.dp,
|
||||
background = {
|
||||
DesktopWall(installed.map { it.iconRes } + apps.mapNotNull { it.icon })
|
||||
WallFade()
|
||||
},
|
||||
background = { DesktopWall(installed.map { it.iconRes } + apps.mapNotNull { it.icon }) },
|
||||
scrim = { WallFade() },
|
||||
words = {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
|
||||
|
||||
@@ -189,6 +189,8 @@ internal fun LiftHero(
|
||||
onOpen: () -> Unit,
|
||||
onPrimary: () -> Unit,
|
||||
background: @Composable () -> Unit,
|
||||
/** Drawn over [background] at the pane's own size: the wall's fades, which must not sink with it. */
|
||||
scrim: @Composable () -> Unit = {},
|
||||
words: @Composable () -> Unit,
|
||||
button: @Composable (onClick: () -> Unit) -> Unit,
|
||||
rows: @Composable (tab: String) -> Unit,
|
||||
@@ -360,6 +362,9 @@ internal fun LiftHero(
|
||||
|
||||
// The wall behind sinks back about the pane's centre.
|
||||
Box(Modifier.fillMaxSize().graphicsLayer { val k = 1f - 0.05f * sink.value; scaleX = k; scaleY = k }) { background() }
|
||||
// The fades stay put: scaled with the wall they stopped short of the pane's edges and left
|
||||
// a bright band of unfaded wall down the side and along the top.
|
||||
scrim()
|
||||
// The dim; a tap on it (above the sheet) folds the sheet away.
|
||||
if (shown || open) Box(
|
||||
Modifier.fillMaxSize().graphicsLayer { alpha = sink.value }.background(Color.Black.copy(alpha = 0.42f))
|
||||
|
||||
@@ -85,14 +85,14 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier)
|
||||
start = if (narrow) 20.dp else 44.dp, bottom = if (narrow) 20.dp else 44.dp,
|
||||
background = {
|
||||
when {
|
||||
games.isEmpty() -> EmptyLibrary(avoid = words) { WallFade() }
|
||||
// The mark wanders over this fade, so it sinks with the wall: drawn a little oversized,
|
||||
// it still reaches the pane's edges at the sink's 0.95.
|
||||
games.isEmpty() -> EmptyLibrary(avoid = words) { Box(Modifier.fillMaxSize().graphicsLayer { scaleX = 1.06f; scaleY = 1.06f }) { WallFade() } }
|
||||
games.size < WALL_MIN_GAMES -> CapsuleFan(games)
|
||||
else -> {
|
||||
CapsuleWall(games)
|
||||
WallFade()
|
||||
}
|
||||
else -> CapsuleWall(games)
|
||||
}
|
||||
},
|
||||
scrim = { if (games.size >= WALL_MIN_GAMES) WallFade() },
|
||||
words = {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
|
||||
Reference in new issue
Block a user