chore: Minor follow up fixes

This commit is contained in:
Christian Pauly 2022-09-10 11:53:39 +02:00
parent ae29343374
commit fa629f8fb7
5 changed files with 26 additions and 16 deletions

View File

@ -574,6 +574,9 @@ class ChatListController extends State<ChatList>
void setActiveClient(Client client) {
VRouter.of(context).to('/rooms');
setState(() {
activeFilter = AppConfig.separateChatTypes
? ActiveFilter.messages
: ActiveFilter.allChats;
activeSpaceId = null;
selectedRoomIds.clear();
Matrix.of(context).setActiveClient(client);

View File

@ -92,7 +92,15 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
),
),
actions: selectMode == SelectMode.share
? null
? [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 8.0,
),
child: ClientChooserButton(controller),
),
]
: selectMode == SelectMode.select
? [
if (controller.spaces.isNotEmpty)

View File

@ -73,14 +73,13 @@ class ChatListView extends StatelessWidget {
),
)
.toList();
final destinations = getNavigationDestinations(context)
..removeLast();
final destinations = getNavigationDestinations(context);
return SizedBox(
width: 64,
child: ListView.builder(
scrollDirection: Axis.vertical,
itemCount: rootSpaces.length +
1 +
2 +
(AppConfig.separateChatTypes ? 1 : 0),
itemBuilder: (context, i) {
if (i < destinations.length) {
@ -95,6 +94,12 @@ class ChatListView extends StatelessWidget {
.secondaryContainer
: Theme.of(context).colorScheme.background,
border: Border(
bottom: i == (destinations.length - 1)
? BorderSide(
width: 1,
color: Theme.of(context).dividerColor,
)
: BorderSide.none,
left: BorderSide(
color: isSelected
? Theme.of(context).colorScheme.primary

View File

@ -111,7 +111,7 @@ class ClientChooserButton extends StatelessWidget {
mxContent: snapshot.data?.avatarUrl,
name: snapshot.data?.displayName ??
client.userID!.localpart,
size: 28,
size: 32,
fontSize: 12,
),
const SizedBox(width: 12),

View File

@ -7,7 +7,6 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
import 'package:matrix/matrix.dart';
import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat_list/chat_list.dart';
import 'package:fluffychat/pages/chat_list/chat_list_item.dart';
import 'package:fluffychat/pages/chat_list/search_title.dart';
@ -193,17 +192,12 @@ class _SpaceViewState extends State<SpaceView> {
itemBuilder: (context, i) {
if (i == 0) {
return ListTile(
leading: FluffyThemes.isColumnMode(context) &&
parentSpace == null
? null
: BackButton(
onPressed: () => widget.controller
.setActiveSpace(parentSpace?.id),
),
leading: BackButton(
onPressed: () =>
widget.controller.setActiveSpace(parentSpace?.id),
),
title: Text(parentSpace == null
? FluffyThemes.isColumnMode(context)
? L10n.of(context)!.showSpaces
: L10n.of(context)!.allSpaces
? L10n.of(context)!.allSpaces
: parentSpace.displayname),
trailing: IconButton(
icon: snapshot.connectionState != ConnectionState.done