Merge branch 'krille/minor-design-fixes' into 'master'
Minor design fixes See merge request ChristianPauly/fluffychat-flutter!95
This commit is contained in:
commit
d9b1510460
|
@ -44,19 +44,34 @@ class PresenceListItem extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(height: 16),
|
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(
|
||||||
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(
|
child: Text(
|
||||||
user.calcDisplayname(),
|
user.calcDisplayname().trim().split(' ').first,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.clip,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xFF555555),
|
color: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyText2
|
||||||
|
.color
|
||||||
|
.withOpacity(0.66),
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
fontWeight: presence?.presence?.statusMsg == null
|
|
||||||
? null
|
|
||||||
: FontWeight.bold,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -51,6 +51,7 @@ class ChatList extends StatefulWidget {
|
||||||
class _ChatListState extends State<ChatList> {
|
class _ChatListState extends State<ChatList> {
|
||||||
bool get searchMode => searchController.text?.isNotEmpty ?? false;
|
bool get searchMode => searchController.text?.isNotEmpty ?? false;
|
||||||
final TextEditingController searchController = TextEditingController();
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
final FocusNode _searchFocusNode = FocusNode();
|
||||||
Timer coolDown;
|
Timer coolDown;
|
||||||
PublicRoomsResponse publicRoomsResponse;
|
PublicRoomsResponse publicRoomsResponse;
|
||||||
bool loadingPublicRooms = false;
|
bool loadingPublicRooms = false;
|
||||||
|
@ -303,10 +304,20 @@ class _ChatListState extends State<ChatList> {
|
||||||
child: TextField(
|
child: TextField(
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
controller: searchController,
|
controller: searchController,
|
||||||
|
focusNode: _searchFocusNode,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: EdgeInsets.all(9),
|
contentPadding: EdgeInsets.all(9),
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
hintText: L10n.of(context).searchForAChat,
|
hintText: L10n.of(context).searchForAChat,
|
||||||
|
suffixIcon: searchMode
|
||||||
|
? IconButton(
|
||||||
|
icon: Icon(Icons.backspace),
|
||||||
|
onPressed: () => setState(() {
|
||||||
|
searchController.clear();
|
||||||
|
_searchFocusNode.unfocus();
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue