chore: adjust design

This commit is contained in:
Krille 2025-01-26 17:30:43 +01:00
parent 8717f1c430
commit 9512e78441
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
3 changed files with 51 additions and 35 deletions

View file

@ -274,6 +274,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
ElevatedButton.icon(
style: ElevatedButton.styleFrom(
foregroundColor: theme.colorScheme.onPrimary,
iconColor: theme.colorScheme.onPrimary,
backgroundColor: theme.colorScheme.primary,
),
icon: _recoveryKeyInputLoading
@ -388,6 +389,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
style: ElevatedButton.styleFrom(
backgroundColor: theme.colorScheme.errorContainer,
foregroundColor: theme.colorScheme.onErrorContainer,
iconColor: theme.colorScheme.onErrorContainer,
),
icon: const Icon(Icons.delete_outlined),
label: Text(L10n.of(context).recoveryKeyLost),
@ -442,7 +444,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
titleText = L10n.of(context).oopsSomethingWentWrong;
body = const Icon(Icons.error_outline, color: Colors.red, size: 80);
buttons.add(
OutlinedButton(
ElevatedButton(
onPressed: () =>
Navigator.of(context, rootNavigator: false).pop<bool>(false),
child: Text(L10n.of(context).close),
@ -468,7 +470,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
],
);
buttons.add(
OutlinedButton(
ElevatedButton(
onPressed: () =>
Navigator.of(context, rootNavigator: false).pop<bool>(false),
child: Text(L10n.of(context).close),
@ -489,13 +491,17 @@ class BootstrapDialogState extends State<BootstrapDialog> {
title: Text(titleText ?? L10n.of(context).loadingPleaseWait),
),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
body,
const SizedBox(height: 8),
...buttons,
],
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
body,
const SizedBox(height: 8),
...buttons,
],
),
),
),
);

View file

@ -9,6 +9,7 @@ import 'package:matrix/matrix.dart';
import 'package:opus_caf_converter_dart/opus_caf_converter_dart.dart';
import 'package:path_provider/path_provider.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat/events/html_message.dart';
import 'package:fluffychat/utils/error_reporter.dart';
@ -350,26 +351,42 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
),
),
const SizedBox(width: 8),
Badge(
isLabelVisible: audioPlayer != null,
label: audioPlayer == null
? null
: Text(
'${audioPlayer.speed.toString()}x',
),
backgroundColor: theme.colorScheme.secondary,
textColor: theme.colorScheme.onSecondary,
child: InkWell(
splashColor: widget.color.withAlpha(128),
borderRadius: BorderRadius.circular(64),
onTap: audioPlayer == null ? null : _toggleSpeed,
AnimatedCrossFade(
firstChild: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(
Icons.mic_none_outlined,
color: widget.color,
),
),
secondChild: Material(
color: widget.color.withAlpha(64),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
child: InkWell(
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
onTap: _toggleSpeed,
child: SizedBox(
width: 32,
height: 20,
child: Center(
child: Text(
'${audioPlayer?.speed.toString()}x',
style: TextStyle(
color: widget.color,
fontSize: 9,
),
),
),
),
),
),
alignment: Alignment.center,
crossFadeState: audioPlayer == null
? CrossFadeState.showFirst
: CrossFadeState.showSecond,
duration: FluffyThemes.animationDuration,
),
const SizedBox(width: 8),
],
),
),

View file

@ -185,7 +185,7 @@ class RecordingDialogState extends State<RecordingDialog> {
CupertinoDialogAction(
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
child: Text(
L10n.of(context).cancel.toUpperCase(),
L10n.of(context).cancel,
style: TextStyle(
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
),
@ -194,7 +194,7 @@ class RecordingDialogState extends State<RecordingDialog> {
if (error != true)
CupertinoDialogAction(
onPressed: _stopAndSend,
child: Text(L10n.of(context).send.toUpperCase()),
child: Text(L10n.of(context).send),
),
],
);
@ -205,23 +205,16 @@ class RecordingDialogState extends State<RecordingDialog> {
TextButton(
onPressed: () => Navigator.of(context, rootNavigator: false).pop(),
child: Text(
L10n.of(context).cancel.toUpperCase(),
L10n.of(context).cancel,
style: TextStyle(
color: theme.textTheme.bodyMedium?.color?.withAlpha(150),
color: theme.colorScheme.error,
),
),
),
if (error != true)
TextButton(
onPressed: _stopAndSend,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(L10n.of(context).send.toUpperCase()),
const SizedBox(width: 4),
const Icon(Icons.send_outlined, size: 15),
],
),
child: Text(L10n.of(context).send),
),
],
);