Merge branch 'main' into 218-improve-interactive-translator
This commit is contained in:
commit
fcf4123556
9 changed files with 32 additions and 27 deletions
|
|
@ -344,9 +344,6 @@ class MessageContent extends StatelessWidget {
|
|||
MatrixLocals(L10n.of(context)!),
|
||||
hideReply: true,
|
||||
);
|
||||
toolbarController?.toolbar?.textSelection.setMessageText(
|
||||
messageText,
|
||||
);
|
||||
return SelectableLinkify(
|
||||
onSelectionChanged: (selection, cause) {
|
||||
if (cause == SelectionChangedCause.longPress &&
|
||||
|
|
@ -363,8 +360,7 @@ class MessageContent extends StatelessWidget {
|
|||
.onTextSelection(selection);
|
||||
},
|
||||
onTap: () => toolbarController?.showToolbar(context),
|
||||
text: toolbarController?.toolbar?.textSelection.messageText ??
|
||||
messageText,
|
||||
text: messageText,
|
||||
contextMenuBuilder: (context, state) =>
|
||||
(toolbarController?.highlighted ?? false)
|
||||
? const SizedBox.shrink()
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class NewGroupView extends StatelessWidget {
|
|||
Expanded(
|
||||
child: TextField(
|
||||
// #Pangea
|
||||
maxLength: 32,
|
||||
maxLength: 64,
|
||||
// Pangea#
|
||||
controller: controller.nameController,
|
||||
autocorrect: false,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class NewSpaceView extends StatelessWidget {
|
|||
Expanded(
|
||||
child: TextField(
|
||||
// #Pangea
|
||||
maxLength: 32,
|
||||
maxLength: 64,
|
||||
// Pangea#
|
||||
controller: controller.nameController,
|
||||
autocorrect: false,
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ extension PangeaRoom on Room {
|
|||
|
||||
Text nameAndRoomTypeIcon([TextStyle? textStyle]) => Text.rich(
|
||||
style: textStyle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
TextSpan(
|
||||
children: [
|
||||
WidgetSpan(
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/src/widgets/visibility.dart' as visible;
|
||||
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/chat_details/chat_details.dart';
|
||||
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/src/widgets/visibility.dart' as visible;
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
class ClassNameHeader extends StatelessWidget {
|
||||
final Room room;
|
||||
|
|
@ -24,14 +22,14 @@ class ClassNameHeader extends StatelessWidget {
|
|||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||
),
|
||||
label: visible.Visibility(
|
||||
icon: visible.Visibility(
|
||||
visible: controller.showEditNameIcon,
|
||||
child: Icon(
|
||||
Icons.edit,
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
),
|
||||
icon: room.nameAndRoomTypeIcon(
|
||||
label: room.nameAndRoomTypeIcon(
|
||||
TextStyle(
|
||||
fontSize: 20,
|
||||
color: Theme.of(context).textTheme.bodyLarge!.color,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ void setClassDisplayname(BuildContext context, String? roomId) async {
|
|||
: L10n.of(context)!.changeTheNameOfTheChat,
|
||||
),
|
||||
content: TextField(
|
||||
maxLength: 32,
|
||||
maxLength: 64,
|
||||
controller: textFieldController,
|
||||
),
|
||||
actions: [
|
||||
|
|
|
|||
|
|
@ -188,10 +188,13 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
currentMode = newMode;
|
||||
updatingMode = true;
|
||||
});
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
currentMode = newMode;
|
||||
updatingMode = true;
|
||||
});
|
||||
}
|
||||
|
||||
if (!subscribed) {
|
||||
toolbarContent = MessageUnsubscribedCard(
|
||||
languageTool: newMode.title(context),
|
||||
|
|
@ -221,9 +224,11 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
break;
|
||||
}
|
||||
}
|
||||
setState(() {
|
||||
updatingMode = false;
|
||||
});
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
updatingMode = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void showTranslation() {
|
||||
|
|
@ -289,7 +294,7 @@ class MessageToolbarState extends State<MessageToolbar> {
|
|||
final bool autoplay = MatrixState.pangeaController.pStoreService.read(
|
||||
PLocalKey.autoPlayMessages,
|
||||
) ??
|
||||
true;
|
||||
false;
|
||||
|
||||
if (widget.pangeaMessageEvent.isAudioMessage) {
|
||||
updateMode(MessageMode.speechToText);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,9 @@ class MessageTranslationCardState extends State<MessageTranslationCard> {
|
|||
l2Code = MatrixState.pangeaController.languageController.activeL2Code(
|
||||
roomID: widget.messageEvent.room.id,
|
||||
);
|
||||
setState(() {});
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
loadTranslation(() async {
|
||||
if (widget.selection.selectedText != null) {
|
||||
|
|
|
|||
|
|
@ -61,9 +61,11 @@ class PangeaRichTextState extends State<PangeaRichText> {
|
|||
widget.toolbarController?.toolbar?.textSelection.setMessageText(
|
||||
newTextSpan,
|
||||
);
|
||||
setState(() {
|
||||
textSpan = newTextSpan;
|
||||
});
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
textSpan = newTextSpan;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void setTextSpan() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue