Skip to content

Commit

Permalink
library: Add shadowElevation to popup and dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongA committed Sep 2, 2024
1 parent e2125b8 commit 2c22aab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
Expand Down Expand Up @@ -90,6 +91,11 @@ fun MiuixSuperDialog(
detectTapGestures { /* Do nothing to consume the click */ }
}
.align(contentAlignment)
.graphicsLayer(
shadowElevation = 50f,
shape = SquircleShape(bottomCornerRadius),
clip = false
)
.background(
color = MiuixTheme.colorScheme.dropdownBackground,
shape = SquircleShape(bottomCornerRadius)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.BlendModeColorFilter
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.onGloballyPositioned
Expand Down Expand Up @@ -215,6 +216,11 @@ fun MiuixSuperDropdown(
)
}
.align(if (alignLeft && !alwaysRight) AbsoluteAlignment.TopLeft else AbsoluteAlignment.TopRight)
.graphicsLayer(
shadowElevation = 50f,
shape = SquircleShape(18.dp),
clip = false
)
.clip(SquircleShape(18.dp))
.background(MiuixTheme.colorScheme.dropdownBackground)
) {
Expand Down

0 comments on commit 2c22aab

Please sign in to comment.