Skip to content

Commit

Permalink
improve ServerElement.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
SpoilerRules committed Sep 28, 2024
1 parent 3546fe1 commit beca27e
Showing 1 changed file with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.animation.core.tween
import androidx.compose.foundation.ContextMenuArea
import androidx.compose.foundation.ContextMenuItem
import androidx.compose.foundation.ContextMenuState
import androidx.compose.foundation.Image
import androidx.compose.foundation.LocalContextMenuRepresentation
import androidx.compose.foundation.background
import androidx.compose.foundation.border
Expand Down Expand Up @@ -385,7 +384,7 @@ fun ServerElement(
modifier =
Modifier
.size(48.dp, 48.dp)
.background(Color.Transparent, shape = RoundedCornerShape(4.dp))
.background(Color.Transparent)
.onHover { isIconHovered = it },
) {
ServerIconImage(
Expand All @@ -402,30 +401,26 @@ fun ServerElement(
Box(
modifier =
Modifier.fillMaxSize()
.clip(RoundedCornerShape(4.dp))
.background(
MapleColorPalette.quaternary.copy(
alpha = overlayAlpha,
),
shape = RoundedCornerShape(8.dp),
),
contentAlignment = Alignment.Center,
) {
Box(
modifier =
Modifier.size(28.dp)
.clip(RoundedCornerShape(4.dp))
Modifier.size(30.dp)
.pointerHoverIcon(PointerIcon.Hand)
.background(
color =
if (isOverlayHovered) {
MapleColorPalette.fadedText.copy(
alpha = secondaryColorAlpha,
)
} else {
Color.Transparent
},
shape = RoundedCornerShape(4.dp),
if (isOverlayHovered) {
MapleColorPalette.fadedText.copy(
alpha = secondaryColorAlpha,
)
} else {
Color.Transparent
},
RoundedCornerShape(6.dp),
)
.onHover { isOverlayHovered = it }
.pointerInput(Unit) {
Expand All @@ -442,12 +437,14 @@ fun ServerElement(
},
contentAlignment = Alignment.Center,
) {
Image(
Icon(
bitmap = IconFactory.copyIcon,
contentDescription =
"Copy Icon for $serverName",
tint = MapleColorPalette.fadedText,
modifier =
Modifier.size(iconSize)
Modifier
.size(iconSize)
.background(Color.Transparent)
.alpha(copyIconAlpha),
)
Expand Down

0 comments on commit beca27e

Please sign in to comment.