Fixed text selection, removed translationEnabled

pull/1183/head
Kelrap 1 year ago
parent 83b30dc084
commit bb01635c9f

@ -303,6 +303,10 @@ class MessageContent extends StatelessWidget {
immersionMode: immersionMode, immersionMode: immersionMode,
toolbarController: toolbarController, toolbarController: toolbarController,
); );
} else if (pangeaMessageEvent != null) {
toolbarController?.toolbar?.textSelection.setMessageText(
pangeaMessageEvent!.body,
);
} }
// Pangea# // Pangea#
return FutureBuilder<String>( return FutureBuilder<String>(

@ -545,11 +545,11 @@ class Choreographer {
chatController.room, chatController.room,
); );
bool get translationEnabled => // bool get translationEnabled =>
pangeaController.permissionsController.isToolEnabled( // pangeaController.permissionsController.isToolEnabled(
ToolSetting.translations, // ToolSetting.translations,
chatController.room, // chatController.room,
); // );
bool get isITandIGCEnabled => bool get isITandIGCEnabled =>
pangeaController.permissionsController.isWritingAssistanceEnabled( pangeaController.permissionsController.isWritingAssistanceEnabled(

@ -17,9 +17,9 @@ class LanguageDisplayToggle extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!controller.choreographer.translationEnabled) { // if (!controller.choreographer.translationEnabled) {
return const SizedBox(); // return const SizedBox();
} // }
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,

@ -131,7 +131,7 @@ class UserController extends BaseController {
final bool? immersionMode = final bool? immersionMode =
migratedProfileInfo(MatrixProfile.immersionMode); migratedProfileInfo(MatrixProfile.immersionMode);
final bool? definitions = migratedProfileInfo(MatrixProfile.definitions); final bool? definitions = migratedProfileInfo(MatrixProfile.definitions);
final bool? translations = migratedProfileInfo(MatrixProfile.translations); // final bool? translations = migratedProfileInfo(MatrixProfile.translations);
final bool? showItInstructions = final bool? showItInstructions =
migratedProfileInfo(MatrixProfile.showedItInstructions); migratedProfileInfo(MatrixProfile.showedItInstructions);
final bool? showClickMessage = final bool? showClickMessage =
@ -147,7 +147,7 @@ class UserController extends BaseController {
interactiveGrammar: interactiveGrammar, interactiveGrammar: interactiveGrammar,
immersionMode: immersionMode, immersionMode: immersionMode,
definitions: definitions, definitions: definitions,
translations: translations, // translations: translations,
showedItInstructions: showItInstructions, showedItInstructions: showItInstructions,
showedClickMessage: showClickMessage, showedClickMessage: showClickMessage,
showedBlurMeansTranslate: showBlurMeansTranslate, showedBlurMeansTranslate: showBlurMeansTranslate,
@ -228,7 +228,7 @@ class UserController extends BaseController {
bool? interactiveGrammar, bool? interactiveGrammar,
bool? immersionMode, bool? immersionMode,
bool? definitions, bool? definitions,
bool? translations, // bool? translations,
bool? showedItInstructions, bool? showedItInstructions,
bool? showedClickMessage, bool? showedClickMessage,
bool? showedBlurMeansTranslate, bool? showedBlurMeansTranslate,
@ -280,12 +280,12 @@ class UserController extends BaseController {
definitions, definitions,
); );
} }
if (translations != null) { // if (translations != null) {
await _pangeaController.pStoreService.save( // await _pangeaController.pStoreService.save(
MatrixProfile.translations.title, // MatrixProfile.translations.title,
translations, // translations,
); // );
} // }
if (showedItInstructions != null) { if (showedItInstructions != null) {
await _pangeaController.pStoreService.save( await _pangeaController.pStoreService.save(
MatrixProfile.showedItInstructions.title, MatrixProfile.showedItInstructions.title,

@ -199,9 +199,9 @@ class PangeaRoomRules {
case ToolSetting.definitions: case ToolSetting.definitions:
definitions = value; definitions = value;
break; break;
case ToolSetting.translations: // case ToolSetting.translations:
translations = value; // translations = value;
break; // break;
case ToolSetting.autoIGC: case ToolSetting.autoIGC:
autoIGC = value; autoIGC = value;
break; break;
@ -275,8 +275,8 @@ class PangeaRoomRules {
return immersionMode; return immersionMode;
case ToolSetting.definitions: case ToolSetting.definitions:
return definitions; return definitions;
case ToolSetting.translations: // case ToolSetting.translations:
return translations; // return translations;
case ToolSetting.autoIGC: case ToolSetting.autoIGC:
return autoIGC; return autoIGC;
default: default:
@ -306,7 +306,7 @@ enum ToolSetting {
interactiveGrammar, interactiveGrammar,
immersionMode, immersionMode,
definitions, definitions,
translations, // translations,
autoIGC, autoIGC,
} }
@ -321,8 +321,8 @@ extension SettingCopy on ToolSetting {
return L10n.of(context)!.toggleImmersionMode; return L10n.of(context)!.toggleImmersionMode;
case ToolSetting.definitions: case ToolSetting.definitions:
return L10n.of(context)!.definitionsToolName; return L10n.of(context)!.definitionsToolName;
case ToolSetting.translations: // case ToolSetting.translations:
return L10n.of(context)!.messageTranslationsToolName; // return L10n.of(context)!.messageTranslationsToolName;
case ToolSetting.autoIGC: case ToolSetting.autoIGC:
return L10n.of(context)!.autoIGCToolName; return L10n.of(context)!.autoIGCToolName;
} }
@ -339,8 +339,8 @@ extension SettingCopy on ToolSetting {
return L10n.of(context)!.toggleImmersionModeDesc; return L10n.of(context)!.toggleImmersionModeDesc;
case ToolSetting.definitions: case ToolSetting.definitions:
return L10n.of(context)!.definitionsToolDescription; return L10n.of(context)!.definitionsToolDescription;
case ToolSetting.translations: // case ToolSetting.translations:
return L10n.of(context)!.translationsToolDescrption; // return L10n.of(context)!.translationsToolDescrption;
case ToolSetting.autoIGC: case ToolSetting.autoIGC:
return L10n.of(context)!.autoIGCToolDescription; return L10n.of(context)!.autoIGCToolDescription;
} }

@ -59,7 +59,7 @@ enum MatrixProfile {
interactiveGrammar, interactiveGrammar,
immersionMode, immersionMode,
definitions, definitions,
translations, // translations,
showedItInstructions, showedItInstructions,
showedClickMessage, showedClickMessage,
showedBlurMeansTranslate, showedBlurMeansTranslate,
@ -88,8 +88,8 @@ extension MatrixProfileExtension on MatrixProfile {
return ToolSetting.immersionMode.toString(); return ToolSetting.immersionMode.toString();
case MatrixProfile.definitions: case MatrixProfile.definitions:
return ToolSetting.definitions.toString(); return ToolSetting.definitions.toString();
case MatrixProfile.translations: // case MatrixProfile.translations:
return ToolSetting.translations.toString(); // return ToolSetting.translations.toString();
case MatrixProfile.autoIGC: case MatrixProfile.autoIGC:
return ToolSetting.autoIGC.toString(); return ToolSetting.autoIGC.toString();
case MatrixProfile.showedItInstructions: case MatrixProfile.showedItInstructions:

Loading…
Cancel
Save