Skip to content

Commit 0ea5b5d

Browse files
committed
Error dialog text now can be selected
1 parent f44d200 commit 0ea5b5d

File tree

1 file changed

+12
-9
lines changed
  • src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/errors

1 file changed

+12
-9
lines changed

src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/errors/ErrorDialog.kt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.jetpackduba.gitnuro.ui.dialogs.errors
22

33
import androidx.compose.foundation.*
44
import androidx.compose.foundation.layout.*
5+
import androidx.compose.foundation.text.selection.SelectionContainer
56
import androidx.compose.material.*
67
import androidx.compose.runtime.*
78
import androidx.compose.ui.Alignment
@@ -32,7 +33,7 @@ fun ErrorDialog(
3233
val clipboard = LocalClipboardManager.current
3334
var showStackTrace by remember { mutableStateOf(false) }
3435

35-
MaterialDialog (
36+
MaterialDialog(
3637
onCloseRequested = onAccept,
3738
) {
3839
Column(
@@ -60,14 +61,16 @@ fun ErrorDialog(
6061
)
6162
}
6263

63-
Text(
64-
text = error.exception.message.orEmpty(), // TODO
65-
color = MaterialTheme.colors.onBackground,
66-
modifier = Modifier
67-
.padding(top = 16.dp)
68-
.widthIn(max = 600.dp),
69-
style = MaterialTheme.typography.body2,
70-
)
64+
SelectionContainer {
65+
Text(
66+
text = error.exception.message.orEmpty(), // TODO
67+
color = MaterialTheme.colors.onBackground,
68+
modifier = Modifier
69+
.padding(top = 16.dp)
70+
.widthIn(max = 600.dp),
71+
style = MaterialTheme.typography.body2,
72+
)
73+
}
7174

7275
if (showStackTrace) {
7376
Box(

0 commit comments

Comments
 (0)