Merge remote-tracking branch 'ggurdin/display-navigation-rail-setting'
This commit is contained in:
commit
970de1f4b0
9 changed files with 129 additions and 102 deletions
|
|
@ -59,6 +59,7 @@ abstract class AppConfig {
|
||||||
static bool swipeRightToLeftToReply = true;
|
static bool swipeRightToLeftToReply = true;
|
||||||
static bool? sendOnEnter;
|
static bool? sendOnEnter;
|
||||||
static bool showPresences = true;
|
static bool showPresences = true;
|
||||||
|
static bool displayNavigationRail = false;
|
||||||
static bool experimentalVoip = false;
|
static bool experimentalVoip = false;
|
||||||
static const bool hideTypingUsernames = false;
|
static const bool hideTypingUsernames = false;
|
||||||
static const bool hideAllStateEvents = false;
|
static const bool hideAllStateEvents = false;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ abstract class SettingKeys {
|
||||||
'chat.fluffy.swipeRightToLeftToReply';
|
'chat.fluffy.swipeRightToLeftToReply';
|
||||||
static const String experimentalVoip = 'chat.fluffy.experimental_voip';
|
static const String experimentalVoip = 'chat.fluffy.experimental_voip';
|
||||||
static const String showPresences = 'chat.fluffy.show_presences';
|
static const String showPresences = 'chat.fluffy.show_presences';
|
||||||
|
static const String displayNavigationRail =
|
||||||
|
'chat.fluffy.display_navigation_rail';
|
||||||
}
|
}
|
||||||
|
|
||||||
enum AppSettings<T> {
|
enum AppSettings<T> {
|
||||||
|
|
|
||||||
|
|
@ -3238,5 +3238,6 @@
|
||||||
"youHaveKnocked": "You have knocked",
|
"youHaveKnocked": "You have knocked",
|
||||||
"pleaseWaitUntilInvited": "Please wait now, until someone from the room invites you.",
|
"pleaseWaitUntilInvited": "Please wait now, until someone from the room invites you.",
|
||||||
"commandHint_logout": "Logout your current device",
|
"commandHint_logout": "Logout your current device",
|
||||||
"commandHint_logoutall": "Logout all active devices"
|
"commandHint_logoutall": "Logout all active devices",
|
||||||
|
"displayNavigationRail": "Show navigation rail on mobile"
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +165,8 @@ class ChatListViewBody extends StatelessWidget {
|
||||||
ActiveFilter.groups,
|
ActiveFilter.groups,
|
||||||
ActiveFilter.unread,
|
ActiveFilter.unread,
|
||||||
if (spaceDelegateCandidates.isNotEmpty &&
|
if (spaceDelegateCandidates.isNotEmpty &&
|
||||||
!controller.widget.displayNavigationRail)
|
!AppConfig.displayNavigationRail &&
|
||||||
|
!FluffyThemes.isColumnMode(context))
|
||||||
ActiveFilter.spaces,
|
ActiveFilter.spaces,
|
||||||
]
|
]
|
||||||
.map(
|
.map(
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/l10n/l10n.dart';
|
import 'package:fluffychat/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||||
|
|
@ -30,8 +31,8 @@ class ChatListView extends StatelessWidget {
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (FluffyThemes.isColumnMode(context) &&
|
if (FluffyThemes.isColumnMode(context) ||
|
||||||
controller.widget.displayNavigationRail) ...[
|
AppConfig.displayNavigationRail) ...[
|
||||||
SpacesNavigationRail(
|
SpacesNavigationRail(
|
||||||
activeSpaceId: controller.activeSpaceId,
|
activeSpaceId: controller.activeSpaceId,
|
||||||
onGoToChats: controller.clearActiveSpace,
|
onGoToChats: controller.clearActiveSpace,
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,11 @@ class NaviRailItem extends StatelessWidget {
|
||||||
bottom: 8,
|
bottom: 8,
|
||||||
left: 0,
|
left: 0,
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
width: isSelected ? 8 : 0,
|
width: isSelected
|
||||||
|
? FluffyThemes.isColumnMode(context)
|
||||||
|
? 8
|
||||||
|
: 4
|
||||||
|
: 0,
|
||||||
duration: FluffyThemes.animationDuration,
|
duration: FluffyThemes.animationDuration,
|
||||||
curve: FluffyThemes.animationCurve,
|
curve: FluffyThemes.animationCurve,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|
|
||||||
|
|
@ -359,6 +359,12 @@ class SettingsStyleView extends StatelessWidget {
|
||||||
storeKey: SettingKeys.separateChatTypes,
|
storeKey: SettingKeys.separateChatTypes,
|
||||||
defaultValue: AppConfig.separateChatTypes,
|
defaultValue: AppConfig.separateChatTypes,
|
||||||
),
|
),
|
||||||
|
SettingsSwitchListTile.adaptive(
|
||||||
|
title: L10n.of(context).displayNavigationRail,
|
||||||
|
onChanged: (b) => AppConfig.displayNavigationRail = b,
|
||||||
|
storeKey: SettingKeys.displayNavigationRail,
|
||||||
|
defaultValue: AppConfig.displayNavigationRail,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
|
|
||||||
AppConfig.showPresences =
|
AppConfig.showPresences =
|
||||||
store.getBool(SettingKeys.showPresences) ?? AppConfig.showPresences;
|
store.getBool(SettingKeys.showPresences) ?? AppConfig.showPresences;
|
||||||
|
|
||||||
|
AppConfig.displayNavigationRail =
|
||||||
|
store.getBool(SettingKeys.displayNavigationRail) ??
|
||||||
|
AppConfig.displayNavigationRail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ class SpacesNavigationRail extends StatelessWidget {
|
||||||
.uri
|
.uri
|
||||||
.path
|
.path
|
||||||
.startsWith('/rooms/settings');
|
.startsWith('/rooms/settings');
|
||||||
return StreamBuilder(
|
return Material(
|
||||||
|
child: SafeArea(
|
||||||
|
child: StreamBuilder(
|
||||||
key: ValueKey(
|
key: ValueKey(
|
||||||
client.userID.toString(),
|
client.userID.toString(),
|
||||||
),
|
),
|
||||||
|
|
@ -52,7 +54,9 @@ class SpacesNavigationRail extends StatelessWidget {
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: FluffyThemes.navRailWidth,
|
width: FluffyThemes.isColumnMode(context)
|
||||||
|
? FluffyThemes.navRailWidth
|
||||||
|
: FluffyThemes.navRailWidth * 0.75,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
@ -89,7 +93,8 @@ class SpacesNavigationRail extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final space = rootSpaces[i];
|
final space = rootSpaces[i];
|
||||||
final displayname = rootSpaces[i].getLocalizedDisplayname(
|
final displayname =
|
||||||
|
rootSpaces[i].getLocalizedDisplayname(
|
||||||
MatrixLocals(L10n.of(context)),
|
MatrixLocals(L10n.of(context)),
|
||||||
);
|
);
|
||||||
final spaceChildrenIds =
|
final spaceChildrenIds =
|
||||||
|
|
@ -132,6 +137,8 @@ class SpacesNavigationRail extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue