chore: Adjust design

pull/1595/head
Krille 8 months ago
parent 5f439a6b58
commit 00165d925e
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -73,7 +73,9 @@ abstract class FluffyThemes {
brightness: brightness, brightness: brightness,
colorScheme: colorScheme, colorScheme: colorScheme,
textTheme: fallbackTextTheme, textTheme: fallbackTextTheme,
dividerColor: colorScheme.surfaceContainer, dividerColor: brightness == Brightness.dark
? colorScheme.surfaceContainerHighest
: colorScheme.surfaceContainer,
popupMenuTheme: PopupMenuThemeData( popupMenuTheme: PopupMenuThemeData(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderRadius: BorderRadius.circular(AppConfig.borderRadius),

@ -181,6 +181,7 @@ class ChatView extends StatelessWidget {
? null ? null
: theme.colorScheme.primary, : theme.colorScheme.primary,
), ),
automaticallyImplyLeading: false,
leading: controller.selectMode leading: controller.selectMode
? IconButton( ? IconButton(
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
@ -188,19 +189,21 @@ class ChatView extends StatelessWidget {
tooltip: L10n.of(context).close, tooltip: L10n.of(context).close,
color: theme.colorScheme.primary, color: theme.colorScheme.primary,
) )
: StreamBuilder<Object>( : FluffyThemes.isColumnMode(context)
stream: Matrix.of(context) ? null
.client : StreamBuilder<Object>(
.onSync stream:
.stream Matrix.of(context).client.onSync.stream.where(
.where((syncUpdate) => syncUpdate.hasRoomUpdate), (syncUpdate) => syncUpdate.hasRoomUpdate,
builder: (context, _) => UnreadRoomsBadge( ),
filter: (r) => r.id != controller.roomId, builder: (context, _) => UnreadRoomsBadge(
badgePosition: BadgePosition.topEnd(end: 8, top: 4), filter: (r) => r.id != controller.roomId,
child: const Center(child: BackButton()), badgePosition:
), BadgePosition.topEnd(end: 8, top: 4),
), child: const Center(child: BackButton()),
titleSpacing: 0, ),
),
titleSpacing: FluffyThemes.isColumnMode(context) ? 32 : 0,
title: ChatAppBarTitle(controller), title: ChatAppBarTitle(controller),
actions: _appBarActions(context), actions: _appBarActions(context),
bottom: PreferredSize( bottom: PreferredSize(

@ -90,7 +90,11 @@ class ParticipantListItem extends StatelessWidget {
), ),
], ],
), ),
subtitle: Text(user.id), subtitle: Text(
user.id,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
leading: Avatar( leading: Avatar(
mxContent: user.avatarUrl, mxContent: user.avatarUrl,
name: user.calcDisplayname(), name: user.calcDisplayname(),

@ -185,20 +185,20 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
], ],
); );
buttons.add( buttons.add(
TextButton.icon( AdaptiveDialogAction(
icon: const Icon(Icons.close),
style: TextButton.styleFrom(foregroundColor: Colors.red),
label: Text(L10n.of(context).reject),
onPressed: () => widget.request onPressed: () => widget.request
.rejectVerification() .rejectVerification()
.then((_) => Navigator.of(context, rootNavigator: false).pop()), .then((_) => Navigator.of(context, rootNavigator: false).pop()),
child: Text(
L10n.of(context).reject,
style: TextStyle(color: theme.colorScheme.error),
),
), ),
); );
buttons.add( buttons.add(
TextButton.icon( AdaptiveDialogAction(
icon: const Icon(Icons.check),
label: Text(L10n.of(context).accept),
onPressed: () => widget.request.acceptVerification(), onPressed: () => widget.request.acceptVerification(),
child: Text(L10n.of(context).accept),
), ),
); );
break; break;
@ -207,6 +207,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
body = Center( body = Center(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const SizedBox(height: 16),
Stack( Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
@ -230,10 +231,9 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
), ),
); );
buttons.add( buttons.add(
TextButton.icon( AdaptiveDialogAction(
icon: const Icon(Icons.close),
label: Text(L10n.of(context).cancel),
onPressed: () => widget.request.cancel(), onPressed: () => widget.request.cancel(),
child: Text(L10n.of(context).cancel),
), ),
); );
@ -271,20 +271,18 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
], ],
); );
buttons.add( buttons.add(
TextButton.icon( AdaptiveDialogAction(
icon: const Icon(Icons.close),
style: TextButton.styleFrom(
foregroundColor: Colors.red,
),
label: Text(L10n.of(context).theyDontMatch),
onPressed: () => widget.request.rejectSas(), onPressed: () => widget.request.rejectSas(),
child: Text(
L10n.of(context).theyDontMatch,
style: TextStyle(color: theme.colorScheme.error),
),
), ),
); );
buttons.add( buttons.add(
TextButton.icon( AdaptiveDialogAction(
icon: const Icon(Icons.check_outlined),
label: Text(L10n.of(context).theyMatch),
onPressed: () => widget.request.acceptSas(), onPressed: () => widget.request.acceptSas(),
child: Text(L10n.of(context).theyMatch),
), ),
); );
break; break;
@ -295,8 +293,9 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
body = Column( body = Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
const SizedBox(height: 16),
const CircularProgressIndicator.adaptive(strokeWidth: 2), const CircularProgressIndicator.adaptive(strokeWidth: 2),
const SizedBox(height: 10), const SizedBox(height: 16),
Text( Text(
acceptText, acceptText,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -305,20 +304,14 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
); );
break; break;
case KeyVerificationState.done: case KeyVerificationState.done:
body = Column( title = Text(L10n.of(context).verifySuccess);
mainAxisSize: MainAxisSize.min, body = const Padding(
children: <Widget>[ padding: EdgeInsets.all(16.0),
const Icon( child: Icon(
Icons.check_circle_outlined, Icons.verified_outlined,
color: Colors.green, color: Colors.green,
size: 128.0, size: 128.0,
), ),
const SizedBox(height: 10),
Text(
L10n.of(context).verifySuccess,
textAlign: TextAlign.center,
),
],
); );
buttons.add( buttons.add(
AdaptiveDialogAction( AdaptiveDialogAction(
@ -334,7 +327,8 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
body = Column( body = Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
const Icon(Icons.cancel, color: Colors.red, size: 128.0), const SizedBox(height: 16),
Icon(Icons.cancel, color: theme.colorScheme.error, size: 64.0),
const SizedBox(height: 16), const SizedBox(height: 16),
// TODO: Add better error UI to user // TODO: Add better error UI to user
Text( Text(

@ -34,12 +34,18 @@ class MaxWidthBody extends StatelessWidget {
maxWidth: FluffyThemes.columnWidth * 1.5, maxWidth: FluffyThemes.columnWidth * 1.5,
), ),
child: Material( child: Material(
elevation: theme.appBarTheme.scrolledUnderElevation ?? 4, shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
side: BorderSide(
color: theme.dividerColor,
),
),
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: child: Padding(
BorderRadius.circular(AppConfig.borderRadius), padding: const EdgeInsets.symmetric(vertical: 16.0),
shadowColor: theme.appBarTheme.shadowColor, child: child,
child: child, ),
), ),
), ),
); );

Loading…
Cancel
Save