Skip to content

Commit

Permalink
also enable for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
StageGuard committed Jul 31, 2024
1 parent e21ae03 commit 74fbfb9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.max
Expand Down Expand Up @@ -747,16 +748,19 @@ object EditCommentDefaults {
OutlinedButton(
onClick = onSend,
enabled = !sending,
modifier = Modifier.padding(start = 4.dp).animateContentSize(),
modifier = Modifier.padding(start = 8.dp).animateContentSize(),
contentPadding = PaddingValues(horizontal = 20.dp, vertical = 8.dp),
) {
Crossfade(targetState = sending) {
if (!it) {
Row(verticalAlignment = Alignment.CenterVertically) {
Text(text = "发送")
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp),
) {
Text(text = "发送", textAlign = TextAlign.Center)
Icon(
imageVector = Icons.AutoMirrored.Rounded.Send,
modifier = Modifier.padding(start = 4.dp).size(18.dp),
modifier = Modifier.padding(start = 4.dp).size(24.dp),
contentDescription = null,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ private fun EpisodeSceneTabletVeryWide(
vm: EpisodeViewModel,
modifier: Modifier = Modifier,
) {
var showEditCommentSheet by rememberSaveable { mutableStateOf(false) }

BoxWithConstraints {
val maxWidth = maxWidth
Row(
Expand Down Expand Up @@ -214,14 +216,23 @@ private fun EpisodeSceneTabletVeryWide(
1 -> EpisodeCommentColumn(
vm.episodeCommentState,
Modifier.fillMaxSize(),
onClickReply = { },
onClickReply = {
vm.editCommentState.handleNewEdit(it)
showEditCommentSheet = true
},
onClickUrl = { },
)
}
}
}
}
}
if (showEditCommentSheet) {
EpisodeEditCommentSheet(
state = vm.editCommentState,
onDismiss = { showEditCommentSheet = false },
)
}
}

@Composable
Expand Down

0 comments on commit 74fbfb9

Please sign in to comment.