mirror of
https://github.com/openflocon/Flocon.git
synced 2026-05-17 02:37:46 +00:00
fix: Bad network
This commit is contained in:
parent
756dd295f0
commit
dc355d38a3
4 changed files with 34 additions and 7 deletions
|
|
@ -6,13 +6,15 @@ import androidx.compose.foundation.layout.height
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.Add
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import io.github.openflocon.flocondesktop.features.network.badquality.list.model.NetworkBadQualityLineUiModel
|
||||
import io.github.openflocon.library.designsystem.components.FloconButton
|
||||
import io.github.openflocon.library.designsystem.components.FloconDialogHeader
|
||||
import io.github.openflocon.library.designsystem.components.FloconIcon
|
||||
import io.github.openflocon.library.designsystem.components.FloconIconTonalButton
|
||||
|
||||
@Composable
|
||||
fun NetworkBadQualityContent(
|
||||
|
|
@ -23,15 +25,17 @@ fun NetworkBadQualityContent(
|
|||
onAddItemClicked: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Column(modifier = modifier) {
|
||||
Column(
|
||||
modifier = modifier.padding(8.dp)
|
||||
) {
|
||||
FloconDialogHeader(
|
||||
title = "Network bad quality",
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
trailingContent = {
|
||||
FloconButton(
|
||||
FloconIconTonalButton(
|
||||
onClick = onAddItemClicked,
|
||||
content = {
|
||||
Text("Create")
|
||||
FloconIcon(Icons.Outlined.Add)
|
||||
}
|
||||
)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package io.github.openflocon.flocondesktop.features.network.mock.list.view
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Row
|
||||
|
|
@ -15,6 +16,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
|
@ -35,11 +37,22 @@ fun MockLineView(
|
|||
changeIsEnabled: (id: String, enabled: Boolean) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val shape = FloconTheme.shapes.small
|
||||
|
||||
Row(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.clip(FloconTheme.shapes.small)
|
||||
.clip(shape)
|
||||
.background(FloconTheme.colorPalette.primary)
|
||||
.border(
|
||||
1.dp,
|
||||
if (item.isEnabled) {
|
||||
FloconTheme.colorPalette.accent
|
||||
} else {
|
||||
Color.Transparent
|
||||
},
|
||||
shape
|
||||
)
|
||||
.clickable(onClick = { onClicked(item.id) })
|
||||
.padding(4.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ private fun NetworkMocksContent(
|
|||
) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
modifier = modifier.padding(8.dp)
|
||||
modifier = modifier
|
||||
.padding(8.dp)
|
||||
) {
|
||||
FloconDialogHeader(
|
||||
title = "Mocks",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import androidx.compose.material3.Text
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.dropShadow
|
||||
import androidx.compose.ui.graphics.shadow.Shadow
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
|
|
@ -39,6 +41,13 @@ fun FloconDialog(
|
|||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(max = 400.dp)
|
||||
.dropShadow(
|
||||
shape = FloconTheme.shapes.large,
|
||||
shadow = Shadow(
|
||||
radius = 16.dp,
|
||||
color = FloconTheme.colorPalette.accent
|
||||
)
|
||||
)
|
||||
) {
|
||||
content()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue