mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
fix(desktop): ripple/hover clipping — correct modifier ordering
- SidebarNavItem/SidebarFeedItem: .clip().clickable().background() — ripple now clipped to RoundedCornerShape(8dp) bounds - ColumnHeader: .padding() before .pointerInput() — gesture detection respects horizontal padding - SearchPill: .clip(pill shape) before .hoverHighlight() — hover drawBehind rect clipped to pill shape, not parent rectangle Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
5e128cb535
commit
55704d520b
+2
-1
@@ -58,11 +58,12 @@ fun ColumnHeader(
|
||||
.fillMaxWidth()
|
||||
.height(48.dp)
|
||||
.background(MaterialTheme.colorScheme.surfaceContainer)
|
||||
.padding(horizontal = 12.dp)
|
||||
.pointerInput(Unit) {
|
||||
detectTapGestures(
|
||||
onDoubleTap = { onDoubleClick() },
|
||||
)
|
||||
}.padding(horizontal = 12.dp),
|
||||
},
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
if (hasBackStack) {
|
||||
|
||||
+2
-2
@@ -417,8 +417,8 @@ private fun SidebarNavItem(
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 2.dp)
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(backgroundColor)
|
||||
.clickable(onClick = onClick)
|
||||
.background(backgroundColor)
|
||||
.onPointerEvent(PointerEventType.Enter) { isHovered = true }
|
||||
.onPointerEvent(PointerEventType.Exit) { isHovered = false }
|
||||
.padding(horizontal = 8.dp, vertical = 8.dp),
|
||||
@@ -489,8 +489,8 @@ private fun SidebarFeedItem(
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 8.dp, vertical = 2.dp)
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.background(backgroundColor)
|
||||
.clickable(onClick = onClick)
|
||||
.background(backgroundColor)
|
||||
.onPointerEvent(PointerEventType.Enter) { isHovered = true }
|
||||
.onPointerEvent(PointerEventType.Exit) { isHovered = false }
|
||||
.padding(horizontal = 8.dp, vertical = 8.dp),
|
||||
|
||||
+2
-1
@@ -33,6 +33,7 @@ import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.vitorpamplona.amethyst.commons.icons.symbols.Icon
|
||||
import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols
|
||||
@@ -49,7 +50,7 @@ fun SearchPill(
|
||||
onClick = onClick,
|
||||
shape = RoundedCornerShape(999.dp),
|
||||
color = MaterialTheme.colorScheme.surfaceContainerHigh,
|
||||
modifier = modifier.height(36.dp).hoverHighlight(),
|
||||
modifier = modifier.height(36.dp).clip(RoundedCornerShape(999.dp)).hoverHighlight(),
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
||||
Reference in New Issue
Block a user