From e5cfacf4c103f0860a9c45a95356cf8872fa714f Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 27 Jun 2020 13:09:21 +0200 Subject: [PATCH] Minor design fixes --- .../list_items/presence_list_item.dart | 31 ++++++++++++++----- lib/views/chat_list.dart | 11 +++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/lib/components/list_items/presence_list_item.dart b/lib/components/list_items/presence_list_item.dart index 6ec1cb77..d694036e 100644 --- a/lib/components/list_items/presence_list_item.dart +++ b/lib/components/list_items/presence_list_item.dart @@ -44,19 +44,34 @@ class PresenceListItem extends StatelessWidget { child: Column( children: [ SizedBox(height: 16), - Avatar(user.avatarUrl, user.calcDisplayname()), + Container( + child: Avatar(user.avatarUrl, user.calcDisplayname()), + decoration: BoxDecoration( + border: Border.all( + width: 1, + color: presence?.presence?.statusMsg == null + ? presence?.presence?.currentlyActive == true + ? Colors.blue + : Theme.of(context).secondaryHeaderColor + : Theme.of(context).primaryColor, + ), + borderRadius: BorderRadius.circular(80), + ), + padding: EdgeInsets.all(2), + ), Padding( - padding: const EdgeInsets.only(left: 6.0, top: 6.0, right: 6.0), + padding: const EdgeInsets.only(left: 6.0, top: 0.0, right: 6.0), child: Text( - user.calcDisplayname(), - overflow: TextOverflow.ellipsis, + user.calcDisplayname().trim().split(' ').first, + overflow: TextOverflow.clip, maxLines: 1, style: TextStyle( - color: Color(0xFF555555), + color: Theme.of(context) + .textTheme + .bodyText2 + .color + .withOpacity(0.66), fontSize: 13, - fontWeight: presence?.presence?.statusMsg == null - ? null - : FontWeight.bold, ), ), ), diff --git a/lib/views/chat_list.dart b/lib/views/chat_list.dart index be5f0419..2b3d106e 100644 --- a/lib/views/chat_list.dart +++ b/lib/views/chat_list.dart @@ -51,6 +51,7 @@ class ChatList extends StatefulWidget { class _ChatListState extends State { bool get searchMode => searchController.text?.isNotEmpty ?? false; final TextEditingController searchController = TextEditingController(); + final FocusNode _searchFocusNode = FocusNode(); Timer coolDown; PublicRoomsResponse publicRoomsResponse; bool loadingPublicRooms = false; @@ -303,10 +304,20 @@ class _ChatListState extends State { child: TextField( autocorrect: false, controller: searchController, + focusNode: _searchFocusNode, decoration: InputDecoration( contentPadding: EdgeInsets.all(9), border: InputBorder.none, hintText: L10n.of(context).searchForAChat, + suffixIcon: searchMode + ? IconButton( + icon: Icon(Icons.backspace), + onPressed: () => setState(() { + searchController.clear(); + _searchFocusNode.unfocus(); + }), + ) + : null, ), ), ),