diff --git a/lib/pages/chat/input_bar.dart b/lib/pages/chat/input_bar.dart index 266bedb88..dc5846036 100644 --- a/lib/pages/chat/input_bar.dart +++ b/lib/pages/chat/input_bar.dart @@ -11,6 +11,7 @@ import 'package:slugify/slugify.dart'; import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/pangea/choreographer/widgets/igc/pangea_text_controller.dart'; +import 'package:fluffychat/pangea/toolbar/utils/shrinkable_text.dart'; import 'package:fluffychat/utils/markdown_context_builder.dart'; import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/widgets/mxc_image.dart'; @@ -30,6 +31,7 @@ class InputBar extends StatelessWidget { // #Pangea // final TextEditingController? controller; final PangeaTextController? controller; + final String hintText; // Pangea# final InputDecoration? decoration; final ValueChanged? onChanged; @@ -50,6 +52,9 @@ class InputBar extends StatelessWidget { this.autofocus, this.textInputAction, this.readOnly = false, + // #Pangea + required this.hintText, + // Pangea# super.key, }); @@ -555,7 +560,23 @@ class InputBar extends StatelessWidget { textCapitalization: TextCapitalization.sentences, ); // fix for issue with typing not working sometimes on Firefox and Safari - return kIsWeb ? SelectionArea(child: textField) : textField; + return Stack( + alignment: Alignment.centerLeft, + children: [ + if (controller != null && controller!.text.isEmpty) + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: ShrinkableText( + text: hintText, + maxWidth: double.infinity, + style: Theme.of(context).textTheme.bodyLarge?.copyWith( + color: Theme.of(context).disabledColor, + ), + ), + ), + kIsWeb ? SelectionArea(child: textField) : textField, + ], + ); }, // builder: (context, controller, focusNode) => TextField( // controller: controller, diff --git a/lib/pangea/chat/widgets/pangea_chat_input_row.dart b/lib/pangea/chat/widgets/pangea_chat_input_row.dart index 6a095ed13..8e0bf3c5f 100644 --- a/lib/pangea/chat/widgets/pangea_chat_input_row.dart +++ b/lib/pangea/chat/widgets/pangea_chat_input_row.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:animations/animations.dart'; @@ -69,8 +68,8 @@ class PangeaChatInputRowState extends State { activel1!.langCode != LanguageKeys.unknownLanguage && activel2!.langCode != LanguageKeys.unknownLanguage ? L10n.of(context).writeAMessageLangCodes( - activel1!.langCodeShort.toUpperCase(), - activel2!.langCodeShort.toUpperCase(), + activel1!.displayName, + activel2!.displayName, ) : L10n.of(context).writeAMessage; } @@ -281,7 +280,7 @@ class PangeaChatInputRowState extends State { ], ), ), - if (kIsWeb) + if (FluffyThemes.isColumnMode(context)) Container( height: height, width: height, @@ -331,14 +330,13 @@ class PangeaChatInputRowState extends State { onSubmitImage: _controller.sendImageFromClipBoard, focusNode: _controller.inputFocus, controller: _controller.sendController, - decoration: InputDecoration( - contentPadding: const EdgeInsets.only( + decoration: const InputDecoration( + contentPadding: EdgeInsets.only( left: 6.0, right: 6.0, bottom: 6.0, top: 3.0, ), - hintText: hintText(), disabledBorder: InputBorder.none, hintMaxLines: 1, border: InputBorder.none, @@ -346,6 +344,7 @@ class PangeaChatInputRowState extends State { filled: false, ), onChanged: _controller.onInputBarChanged, + hintText: hintText(), ), ), ),