feat: Compose Text 图标颜色

This commit is contained in:
HuanCheng65 2023-03-12 14:11:38 +08:00
parent 5ff4c37a09
commit f00a79ebc3
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
1 changed files with 6 additions and 3 deletions

View File

@ -33,6 +33,7 @@ import androidx.compose.ui.unit.sp
import com.huanchengfly.tieba.post.R import com.huanchengfly.tieba.post.R
import com.huanchengfly.tieba.post.pxToDp import com.huanchengfly.tieba.post.pxToDp
import com.huanchengfly.tieba.post.pxToSp import com.huanchengfly.tieba.post.pxToSp
import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme
import com.huanchengfly.tieba.post.utils.EmoticonManager import com.huanchengfly.tieba.post.utils.EmoticonManager
import com.huanchengfly.tieba.post.utils.EmoticonManager.getEmoticonHeightPx import com.huanchengfly.tieba.post.utils.EmoticonManager.getEmoticonHeightPx
import com.huanchengfly.tieba.post.utils.EmoticonUtil.emoticonString import com.huanchengfly.tieba.post.utils.EmoticonUtil.emoticonString
@ -180,7 +181,7 @@ fun IconText(
letterSpacing = letterSpacing letterSpacing = letterSpacing
) )
) )
val sizePx = getEmoticonHeightPx(mergedStyle) val sizePx = getEmoticonHeightPx(mergedStyle) * 9 / 10
val sizeSp = sizePx.pxToSp().sp val sizeSp = sizePx.pxToSp().sp
val sizeDp = sizePx.pxToDp().dp val sizeDp = sizePx.pxToDp().dp
val iconInlineContent = val iconInlineContent =
@ -196,7 +197,8 @@ fun IconText(
Icon( Icon(
Icons.Rounded.Link, Icons.Rounded.Link,
contentDescription = stringResource(id = R.string.link), contentDescription = stringResource(id = R.string.link),
modifier = Modifier.size(sizeDp) modifier = Modifier.size(sizeDp),
tint = ExtendedTheme.colors.accent,
) )
} }
), ),
@ -210,7 +212,8 @@ fun IconText(
Icon( Icon(
Icons.Rounded.AccountCircle, Icons.Rounded.AccountCircle,
contentDescription = stringResource(id = R.string.user), contentDescription = stringResource(id = R.string.user),
modifier = Modifier.size(sizeDp) modifier = Modifier.size(sizeDp),
tint = ExtendedTheme.colors.accent,
) )
} }
), ),