desktop: enter + shift+enter keybindings (#2787)

This commit is contained in:
Stanislav Dmitrenko
2023-07-27 15:44:35 +03:00
committed by GitHub
parent 976fc68cc3
commit a3cd7ca89e
4 changed files with 36 additions and 8 deletions
@@ -11,5 +11,6 @@ expect fun PlatformTextField(
textStyle: MutableState<TextStyle>,
showDeleteTextButton: MutableState<Boolean>,
userIsObserver: Boolean,
onMessageChange: (String) -> Unit
onMessageChange: (String) -> Unit,
onDone: () -> Unit,
)
@@ -67,7 +67,9 @@ fun SendMsgView(
val showVoiceButton = cs.message.isEmpty() && showVoiceRecordIcon && !composeState.value.editing &&
cs.liveMessage == null && (cs.preview is ComposePreview.NoPreview || recState.value is RecordingState.Started)
val showDeleteTextButton = rememberSaveable { mutableStateOf(false) }
PlatformTextField(composeState, textStyle, showDeleteTextButton, userIsObserver, onMessageChange)
PlatformTextField(composeState, textStyle, showDeleteTextButton, userIsObserver, onMessageChange) {
sendMessage(null)
}
// Disable clicks on text field
if (cs.preview is ComposePreview.VoicePreview || !userCanSend || cs.inProgress) {
Box(