From dc355d38a334c49dff2cabbbe54d6567970f854f Mon Sep 17 00:00:00 2001 From: TEYSSANDIER Raphael Date: Fri, 5 Sep 2025 10:18:01 +0200 Subject: [PATCH] fix: Bad network --- .../list/view/NetworkBadQualityContent.kt | 14 +++++++++----- .../network/mock/list/view/MockLineView.kt | 15 ++++++++++++++- .../network/mock/list/view/NetworkMocksScreen.kt | 3 ++- .../designsystem/components/FloconDialog.kt | 9 +++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/badquality/list/view/NetworkBadQualityContent.kt b/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/badquality/list/view/NetworkBadQualityContent.kt index 37f8ba0b..521e36fa 100644 --- a/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/badquality/list/view/NetworkBadQualityContent.kt +++ b/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/badquality/list/view/NetworkBadQualityContent.kt @@ -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) } ) }, diff --git a/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/MockLineView.kt b/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/MockLineView.kt index 3ef0fc2d..05b23205 100644 --- a/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/MockLineView.kt +++ b/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/MockLineView.kt @@ -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), diff --git a/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/NetworkMocksScreen.kt b/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/NetworkMocksScreen.kt index ab328ce8..633f79f2 100644 --- a/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/NetworkMocksScreen.kt +++ b/FloconDesktop/composeApp/src/commonMain/kotlin/io/github/openflocon/flocondesktop/features/network/mock/list/view/NetworkMocksScreen.kt @@ -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", diff --git a/FloconDesktop/library/designsystem/src/commonMain/kotlin/io/github/openflocon/library/designsystem/components/FloconDialog.kt b/FloconDesktop/library/designsystem/src/commonMain/kotlin/io/github/openflocon/library/designsystem/components/FloconDialog.kt index 37d5babe..967b100b 100644 --- a/FloconDesktop/library/designsystem/src/commonMain/kotlin/io/github/openflocon/library/designsystem/components/FloconDialog.kt +++ b/FloconDesktop/library/designsystem/src/commonMain/kotlin/io/github/openflocon/library/designsystem/components/FloconDialog.kt @@ -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() }