mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 06:52:35 +01:00
chore: Minor follow up fixes
This commit is contained in:
parent
ae29343374
commit
fa629f8fb7
@ -574,6 +574,9 @@ class ChatListController extends State<ChatList>
|
|||||||
void setActiveClient(Client client) {
|
void setActiveClient(Client client) {
|
||||||
VRouter.of(context).to('/rooms');
|
VRouter.of(context).to('/rooms');
|
||||||
setState(() {
|
setState(() {
|
||||||
|
activeFilter = AppConfig.separateChatTypes
|
||||||
|
? ActiveFilter.messages
|
||||||
|
: ActiveFilter.allChats;
|
||||||
activeSpaceId = null;
|
activeSpaceId = null;
|
||||||
selectedRoomIds.clear();
|
selectedRoomIds.clear();
|
||||||
Matrix.of(context).setActiveClient(client);
|
Matrix.of(context).setActiveClient(client);
|
||||||
|
@ -92,7 +92,15 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: selectMode == SelectMode.share
|
actions: selectMode == SelectMode.share
|
||||||
? null
|
? [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.0,
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
|
child: ClientChooserButton(controller),
|
||||||
|
),
|
||||||
|
]
|
||||||
: selectMode == SelectMode.select
|
: selectMode == SelectMode.select
|
||||||
? [
|
? [
|
||||||
if (controller.spaces.isNotEmpty)
|
if (controller.spaces.isNotEmpty)
|
||||||
|
@ -73,14 +73,13 @@ class ChatListView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
final destinations = getNavigationDestinations(context)
|
final destinations = getNavigationDestinations(context);
|
||||||
..removeLast();
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 64,
|
width: 64,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
itemCount: rootSpaces.length +
|
itemCount: rootSpaces.length +
|
||||||
1 +
|
2 +
|
||||||
(AppConfig.separateChatTypes ? 1 : 0),
|
(AppConfig.separateChatTypes ? 1 : 0),
|
||||||
itemBuilder: (context, i) {
|
itemBuilder: (context, i) {
|
||||||
if (i < destinations.length) {
|
if (i < destinations.length) {
|
||||||
@ -95,6 +94,12 @@ class ChatListView extends StatelessWidget {
|
|||||||
.secondaryContainer
|
.secondaryContainer
|
||||||
: Theme.of(context).colorScheme.background,
|
: Theme.of(context).colorScheme.background,
|
||||||
border: Border(
|
border: Border(
|
||||||
|
bottom: i == (destinations.length - 1)
|
||||||
|
? BorderSide(
|
||||||
|
width: 1,
|
||||||
|
color: Theme.of(context).dividerColor,
|
||||||
|
)
|
||||||
|
: BorderSide.none,
|
||||||
left: BorderSide(
|
left: BorderSide(
|
||||||
color: isSelected
|
color: isSelected
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
|
@ -111,7 +111,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||||||
mxContent: snapshot.data?.avatarUrl,
|
mxContent: snapshot.data?.avatarUrl,
|
||||||
name: snapshot.data?.displayName ??
|
name: snapshot.data?.displayName ??
|
||||||
client.userID!.localpart,
|
client.userID!.localpart,
|
||||||
size: 28,
|
size: 32,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
|
@ -7,7 +7,6 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:vrouter/vrouter.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.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/chat_list_item.dart';
|
import 'package:fluffychat/pages/chat_list/chat_list_item.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/search_title.dart';
|
import 'package:fluffychat/pages/chat_list/search_title.dart';
|
||||||
@ -193,17 +192,12 @@ class _SpaceViewState extends State<SpaceView> {
|
|||||||
itemBuilder: (context, i) {
|
itemBuilder: (context, i) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: FluffyThemes.isColumnMode(context) &&
|
leading: BackButton(
|
||||||
parentSpace == null
|
onPressed: () =>
|
||||||
? null
|
widget.controller.setActiveSpace(parentSpace?.id),
|
||||||
: BackButton(
|
),
|
||||||
onPressed: () => widget.controller
|
|
||||||
.setActiveSpace(parentSpace?.id),
|
|
||||||
),
|
|
||||||
title: Text(parentSpace == null
|
title: Text(parentSpace == null
|
||||||
? FluffyThemes.isColumnMode(context)
|
? L10n.of(context)!.allSpaces
|
||||||
? L10n.of(context)!.showSpaces
|
|
||||||
: L10n.of(context)!.allSpaces
|
|
||||||
: parentSpace.displayname),
|
: parentSpace.displayname),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
icon: snapshot.connectionState != ConnectionState.done
|
icon: snapshot.connectionState != ConnectionState.done
|
||||||
|
Loading…
Reference in New Issue
Block a user