mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 11:42:22 +08:00
perf: title padding
This commit is contained in:
parent
317906f858
commit
ed1f810e73
|
@ -74,6 +74,7 @@ import li.songe.gkd.ui.component.SettingItem
|
|||
import li.songe.gkd.ui.component.TextSwitch
|
||||
import li.songe.gkd.ui.destinations.SnapshotPageDestination
|
||||
import li.songe.gkd.ui.style.itemPadding
|
||||
import li.songe.gkd.ui.style.titleItemPadding
|
||||
import li.songe.gkd.util.LocalLauncher
|
||||
import li.songe.gkd.util.LocalNavController
|
||||
import li.songe.gkd.util.ProfileTransitions
|
||||
|
@ -125,7 +126,7 @@ fun AdvancedPage() {
|
|||
) {
|
||||
Text(
|
||||
text = "Shizuku",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
@ -151,7 +152,7 @@ fun AdvancedPage() {
|
|||
|
||||
Text(
|
||||
text = "HTTP服务",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
@ -246,7 +247,7 @@ fun AdvancedPage() {
|
|||
|
||||
Text(
|
||||
text = "快照",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
@ -336,7 +337,7 @@ fun AdvancedPage() {
|
|||
|
||||
Text(
|
||||
text = "其它",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
|
|
@ -52,6 +52,7 @@ import li.songe.gkd.ui.component.TextSwitch
|
|||
import li.songe.gkd.ui.destinations.AboutPageDestination
|
||||
import li.songe.gkd.ui.destinations.AdvancedPageDestination
|
||||
import li.songe.gkd.ui.style.itemPadding
|
||||
import li.songe.gkd.ui.style.titleItemPadding
|
||||
import li.songe.gkd.ui.theme.supportDynamicColor
|
||||
import li.songe.gkd.util.DarkThemeOption
|
||||
import li.songe.gkd.util.LoadStatus
|
||||
|
@ -259,7 +260,7 @@ fun useSettingsPage(): ScaffoldExt {
|
|||
|
||||
Text(
|
||||
text = "常规",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
@ -311,7 +312,7 @@ fun useSettingsPage(): ScaffoldExt {
|
|||
|
||||
Text(
|
||||
text = "更新",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
@ -358,7 +359,7 @@ fun useSettingsPage(): ScaffoldExt {
|
|||
|
||||
Text(
|
||||
text = "日志",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
@ -395,7 +396,7 @@ fun useSettingsPage(): ScaffoldExt {
|
|||
|
||||
Text(
|
||||
text = "其它",
|
||||
modifier = Modifier.itemPadding(),
|
||||
modifier = Modifier.titleItemPadding(),
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
)
|
||||
|
|
|
@ -5,7 +5,18 @@ import androidx.compose.material3.MenuDefaults
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
fun Modifier.itemPadding() = this then padding(16.dp, 12.dp)
|
||||
val itemHorizontalPadding = 16.dp
|
||||
val itemVerticalPadding = 12.dp
|
||||
|
||||
fun Modifier.itemPadding() = this then padding(itemHorizontalPadding, itemVerticalPadding)
|
||||
|
||||
fun Modifier.titleItemPadding() =
|
||||
this then padding(
|
||||
itemHorizontalPadding,
|
||||
itemVerticalPadding + itemVerticalPadding / 2,
|
||||
itemHorizontalPadding,
|
||||
itemVerticalPadding - itemVerticalPadding / 2
|
||||
)
|
||||
|
||||
fun Modifier.appItemPadding() = this then padding(10.dp, 10.dp)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user