From f10c200e12a79077babaab9364155974b38f23bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= <sebastian@mobanisto.de> Date: Wed, 12 Jul 2023 11:42:33 +0200 Subject: [PATCH] Improve copy and pasting dependency rows Add tiny additional cells to hack output of selecting a row and copy and pasting it somewhere to make it appear as "group:artifact:version license". --- .../org/briarproject/briar/desktop/ui/AboutScreen.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt index 85c6518e73..2626a30ae6 100644 --- a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt +++ b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics @@ -49,6 +50,7 @@ import org.briarproject.briar.desktop.utils.PreviewUtils.preview import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter +import kotlin.Float.Companion.MIN_VALUE @Suppress("HardCodedStringLiteral") fun main() = preview( @@ -239,11 +241,16 @@ val colSizesLibraries = listOf(0.3f, 0.3f, 0.15f, 0.25f) private fun LibraryEntry(artifact: Artifact) = SelectionContainer { Row(Modifier.fillMaxWidth().height(IntrinsicSize.Min)) { + // Add tiny cells in between so that one can select a row, copy and paste + // it somewhere and appear like "group:artifact:version license". Cell(colSizesLibraries[0], artifact.group) + Cell(MIN_VALUE, ":"); VerticalDivider() Cell(colSizesLibraries[1], artifact.artifact) + Cell(MIN_VALUE, ":"); VerticalDivider() Cell(colSizesLibraries[2], artifact.version) + Cell(MIN_VALUE, "\t"); VerticalDivider() Cell(colSizesLibraries[3], artifact.license) } -- GitLab