Skip to content

Commit

Permalink
moved language assistance button into chat input row
Browse files Browse the repository at this point in the history
  • Loading branch information
ggurdin committed Nov 14, 2024
1 parent 42f9c7b commit 9ed2694
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 170 deletions.
95 changes: 54 additions & 41 deletions lib/pages/chat/chat_input_row.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:animations/animations.dart';
import 'package:fluffychat/pangea/choreographer/widgets/send_button.dart';
import 'package:fluffychat/pangea/choreographer/widgets/start_igc_button.dart';
import 'package:fluffychat/pangea/constants/language_constants.dart';
import 'package:fluffychat/pangea/widgets/chat/pangea_reaction_picker.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/matrix.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:material_symbols_icons/symbols.dart';
Expand Down Expand Up @@ -274,48 +276,54 @@ class ChatInputRow extends StatelessWidget {
],
),
),
Container(
height: height,
width: height,
alignment: Alignment.center,
child:
// #Pangea
// KeyBoardShortcuts(
// keysToPress: {
// LogicalKeyboardKey.altLeft,
// LogicalKeyboardKey.keyE,
// },
// onKeysPressed: controller.emojiPickerAction,
// helpLabel: L10n.of(context)!.emojis,
// child:
// Pangea#
IconButton(
tooltip: L10n.of(context)!.emojis,
icon: PageTransitionSwitcher(
transitionBuilder: (
Widget child,
Animation<double> primaryAnimation,
Animation<double> secondaryAnimation,
) {
return SharedAxisTransition(
animation: primaryAnimation,
secondaryAnimation: secondaryAnimation,
transitionType: SharedAxisTransitionType.scaled,
fillColor: Colors.transparent,
child: child,
);
},
child: Icon(
controller.showEmojiPicker
? Icons.keyboard
: Icons.add_reaction_outlined,
key: ValueKey(controller.showEmojiPicker),
),
),
onPressed: controller.emojiPickerAction,
),
),
// #Pangea
kIsWeb
?
// Pangea#
Container(
height: height,
width: height,
alignment: Alignment.center,
child:
// #Pangea
// KeyBoardShortcuts(
// keysToPress: {
// LogicalKeyboardKey.altLeft,
// LogicalKeyboardKey.keyE,
// },
// onKeysPressed: controller.emojiPickerAction,
// helpLabel: L10n.of(context)!.emojis,
// child:
// Pangea#
IconButton(
tooltip: L10n.of(context)!.emojis,
icon: PageTransitionSwitcher(
transitionBuilder: (
Widget child,
Animation<double> primaryAnimation,
Animation<double> secondaryAnimation,
) {
return SharedAxisTransition(
animation: primaryAnimation,
secondaryAnimation: secondaryAnimation,
transitionType:
SharedAxisTransitionType.scaled,
fillColor: Colors.transparent,
child: child,
);
},
child: Icon(
controller.showEmojiPicker
? Icons.keyboard
: Icons.add_reaction_outlined,
key: ValueKey(controller.showEmojiPicker),
),
),
onPressed: controller.emojiPickerAction,
),
)
// #Pangea
: const SizedBox(width: 10),
// if (Matrix.of(context).isMultiAccount &&
// Matrix.of(context).hasComplexBundles &&
// Matrix.of(context).currentBundle!.length > 1)
Expand Down Expand Up @@ -369,6 +377,11 @@ class ChatInputRow extends StatelessWidget {
),
),
),
// #Pangea
StartIGCButton(
controller: controller,
),
// Pangea#
Container(
height: height,
width: height,
Expand Down
29 changes: 10 additions & 19 deletions lib/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:fluffychat/pages/chat/chat_event_list.dart';
import 'package:fluffychat/pages/chat/pinned_events.dart';
import 'package:fluffychat/pages/chat/reply_display.dart';
import 'package:fluffychat/pangea/choreographer/widgets/it_bar.dart';
import 'package:fluffychat/pangea/choreographer/widgets/start_igc_button.dart';
import 'package:fluffychat/pangea/controllers/put_analytics_controller.dart';
import 'package:fluffychat/pangea/extensions/pangea_room_extension/pangea_room_extension.dart';
import 'package:fluffychat/pangea/widgets/animations/gain_points.dart';
Expand Down Expand Up @@ -443,26 +442,18 @@ class ChatView extends StatelessWidget {
maxWidth: FluffyThemes.columnWidth * 2.4,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.end,
children: [
StartIGCButton(
controller: controller,
PointsGainedAnimation(
gainColor: Theme.of(context)
.colorScheme
.onPrimary,
origin:
AnalyticsUpdateOrigin.sendMessage,
),
Row(
children: [
PointsGainedAnimation(
gainColor: Theme.of(context)
.colorScheme
.onPrimary,
origin: AnalyticsUpdateOrigin
.sendMessage,
),
const SizedBox(width: 100),
ChatFloatingActionButton(
controller: controller,
),
],
const SizedBox(width: 100),
ChatFloatingActionButton(
controller: controller,
),
],
),
Expand Down
44 changes: 23 additions & 21 deletions lib/pangea/choreographer/widgets/send_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,28 @@ class ChoreographerSendButtonState extends State<ChoreographerSendButton> {

@override
Widget build(BuildContext context) {
return widget.controller.choreographer.isFetching &&
widget.controller.choreographer.isAutoIGCEnabled
? Container(
height: 56,
width: 56,
padding: const EdgeInsets.all(13),
child: const CircularProgressIndicator(),
)
: Container(
height: 56,
alignment: Alignment.center,
child: IconButton(
icon: const Icon(Icons.send_outlined),
color: widget.controller.choreographer.assistanceState
.stateColor(context),
onPressed: () {
widget.controller.choreographer.send(context);
},
tooltip: L10n.of(context)!.send,
),
);
return
// widget.controller.choreographer.isFetching &&
// widget.controller.choreographer.isAutoIGCEnabled
// ? Container(
// height: 56,
// width: 56,
// padding: const EdgeInsets.all(13),
// child: const CircularProgressIndicator(),
// )
// :
Container(
height: 56,
alignment: Alignment.center,
child: IconButton(
icon: const Icon(Icons.send_outlined),
color:
widget.controller.choreographer.assistanceState.stateColor(context),
onPressed: () {
widget.controller.choreographer.send(context);
},
tooltip: L10n.of(context)!.send,
),
);
}
}
Loading

0 comments on commit 9ed2694

Please sign in to comment.