mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +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.component.TextSwitch
|
||||||
import li.songe.gkd.ui.destinations.SnapshotPageDestination
|
import li.songe.gkd.ui.destinations.SnapshotPageDestination
|
||||||
import li.songe.gkd.ui.style.itemPadding
|
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.LocalLauncher
|
||||||
import li.songe.gkd.util.LocalNavController
|
import li.songe.gkd.util.LocalNavController
|
||||||
import li.songe.gkd.util.ProfileTransitions
|
import li.songe.gkd.util.ProfileTransitions
|
||||||
|
@ -125,7 +126,7 @@ fun AdvancedPage() {
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "Shizuku",
|
text = "Shizuku",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
@ -151,7 +152,7 @@ fun AdvancedPage() {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "HTTP服务",
|
text = "HTTP服务",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
@ -246,7 +247,7 @@ fun AdvancedPage() {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "快照",
|
text = "快照",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
@ -336,7 +337,7 @@ fun AdvancedPage() {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "其它",
|
text = "其它",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
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.AboutPageDestination
|
||||||
import li.songe.gkd.ui.destinations.AdvancedPageDestination
|
import li.songe.gkd.ui.destinations.AdvancedPageDestination
|
||||||
import li.songe.gkd.ui.style.itemPadding
|
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.ui.theme.supportDynamicColor
|
||||||
import li.songe.gkd.util.DarkThemeOption
|
import li.songe.gkd.util.DarkThemeOption
|
||||||
import li.songe.gkd.util.LoadStatus
|
import li.songe.gkd.util.LoadStatus
|
||||||
|
@ -259,7 +260,7 @@ fun useSettingsPage(): ScaffoldExt {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "常规",
|
text = "常规",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
@ -311,7 +312,7 @@ fun useSettingsPage(): ScaffoldExt {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "更新",
|
text = "更新",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
@ -358,7 +359,7 @@ fun useSettingsPage(): ScaffoldExt {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "日志",
|
text = "日志",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
@ -395,7 +396,7 @@ fun useSettingsPage(): ScaffoldExt {
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "其它",
|
text = "其它",
|
||||||
modifier = Modifier.itemPadding(),
|
modifier = Modifier.titleItemPadding(),
|
||||||
style = MaterialTheme.typography.titleSmall,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,18 @@ import androidx.compose.material3.MenuDefaults
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
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)
|
fun Modifier.appItemPadding() = this then padding(10.dp, 10.dp)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user