From 099f9cf881f06ef1bc6f5ae2ed8f6bbf93e25862 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 19 Nov 2021 10:33:26 +0100 Subject: [PATCH] change: Move video call button to menu --- lib/pages/chat/chat.dart | 3 +++ lib/pages/chat/chat_input_row.dart | 12 ++++++++++++ lib/pages/chat/chat_view.dart | 6 ------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 373963ca..f22a534e 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -756,6 +756,9 @@ class ChatController extends State { if (choice == 'location') { sendLocationAction(); } + if (choice == 'videocall') { + startCallAction(); + } } void onInputBarChanged(String text) { diff --git a/lib/pages/chat/chat_input_row.dart b/lib/pages/chat/chat_input_row.dart index f2257097..d555be31 100644 --- a/lib/pages/chat/chat_input_row.dart +++ b/lib/pages/chat/chat_input_row.dart @@ -80,6 +80,18 @@ class ChatInputRow extends StatelessWidget { onSelected: controller.onAddPopupMenuButtonSelected, itemBuilder: (BuildContext context) => >[ + PopupMenuItem( + value: 'videocall', + child: ListTile( + leading: const CircleAvatar( + backgroundColor: Colors.blueGrey, + foregroundColor: Colors.white, + child: Icon(Icons.video_call_outlined), + ), + title: Text(L10n.of(context).videoCall), + contentPadding: const EdgeInsets.all(0), + ), + ), PopupMenuItem( value: 'file', child: ListTile( diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 8231e072..3b0bef1a 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -96,12 +96,6 @@ class ChatView extends StatelessWidget { ), ] : [ - if (controller.room.canSendDefaultStates) - IconButton( - tooltip: L10n.of(context).videoCall, - icon: const Icon(Icons.video_call_outlined), - onPressed: controller.startCallAction, - ), ChatSettingsPopupMenu(controller.room, !controller.room.isDirectChat), ];