diff --git a/lib/config/themes.dart b/lib/config/themes.dart index 31ad44be..342c5625 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -9,7 +9,10 @@ import 'app_config.dart'; abstract class FluffyThemes { static const double columnWidth = 360.0; - static bool isColumnModeByWidth(double width) => width > columnWidth * 2 + 64; + static const double navRailWidth = 64.0; + + static bool isColumnModeByWidth(double width) => + width > columnWidth * 2 + navRailWidth; static bool isColumnMode(BuildContext context) => isColumnModeByWidth(MediaQuery.of(context).size.width); diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 1aa57706..7406bee0 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -93,10 +93,9 @@ class ChatListController extends State int get selectedIndex { switch (activeFilter) { case ActiveFilter.allChats: + case ActiveFilter.messages: return 0; case ActiveFilter.groups: - return 0; - case ActiveFilter.messages: return 1; case ActiveFilter.spaces: return AppConfig.separateChatTypes ? 2 : 1; @@ -107,7 +106,7 @@ class ChatListController extends State switch (i) { case 1: if (AppConfig.separateChatTypes) { - return ActiveFilter.messages; + return ActiveFilter.groups; } return ActiveFilter.spaces; case 2: @@ -115,7 +114,7 @@ class ChatListController extends State case 0: default: if (AppConfig.separateChatTypes) { - return ActiveFilter.groups; + return ActiveFilter.messages; } return ActiveFilter.allChats; } diff --git a/lib/pages/chat_list/chat_list_view.dart b/lib/pages/chat_list/chat_list_view.dart index 81b44f9d..64b1ad91 100644 --- a/lib/pages/chat_list/chat_list_view.dart +++ b/lib/pages/chat_list/chat_list_view.dart @@ -27,19 +27,6 @@ class ChatListView extends StatelessWidget { final badgePosition = BadgePosition.topEnd(top: -12, end: -8); return [ if (AppConfig.separateChatTypes) ...[ - NavigationDestination( - icon: UnreadRoomsBadge( - badgePosition: badgePosition, - filter: controller.getRoomFilterByActiveFilter(ActiveFilter.groups), - child: const Icon(Icons.groups_outlined), - ), - selectedIcon: UnreadRoomsBadge( - badgePosition: badgePosition, - filter: controller.getRoomFilterByActiveFilter(ActiveFilter.groups), - child: const Icon(Icons.groups), - ), - label: L10n.of(context)!.groups, - ), NavigationDestination( icon: UnreadRoomsBadge( badgePosition: badgePosition, @@ -55,6 +42,19 @@ class ChatListView extends StatelessWidget { ), label: L10n.of(context)!.messages, ), + NavigationDestination( + icon: UnreadRoomsBadge( + badgePosition: badgePosition, + filter: controller.getRoomFilterByActiveFilter(ActiveFilter.groups), + child: const Icon(Icons.groups_outlined), + ), + selectedIcon: UnreadRoomsBadge( + badgePosition: badgePosition, + filter: controller.getRoomFilterByActiveFilter(ActiveFilter.groups), + child: const Icon(Icons.groups), + ), + label: L10n.of(context)!.groups, + ), ] else NavigationDestination( icon: UnreadRoomsBadge( @@ -124,7 +124,7 @@ class ChatListView extends StatelessWidget { final destinations = getNavigationDestinations(context); return SizedBox( - width: 64, + width: FluffyThemes.navRailWidth, child: ListView.builder( scrollDirection: Axis.vertical, itemCount: rootSpaces.length + destinations.length,