Misc UI fixes

This commit is contained in:
Elias Bonnici 2024-04-25 15:26:33 +02:00
parent 63bb6292a5
commit b5b5804f3a
No known key found for this signature in database
GPG Key ID: 5EAC28EA3F980CCF
10 changed files with 114 additions and 87 deletions

View File

@ -60,9 +60,13 @@ class CredentialDialog extends ConsumerWidget {
top: 48, bottom: 32, left: 16, right: 16),
child: Column(
children: [
const Padding(
padding: EdgeInsets.all(16),
child: Icon(Symbols.passkey, size: 72),
Padding(
padding: const EdgeInsets.all(16),
child: Icon(
Symbols.passkey,
size: 100,
color: Theme.of(context).colorScheme.onSurface,
),
),
CredentialInfoTable(credential),
],

View File

@ -81,7 +81,11 @@ class FingerprintDialog extends ConsumerWidget {
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
const Icon(Symbols.fingerprint, size: 72),
Icon(
Symbols.fingerprint,
size: 100,
color: Theme.of(context).colorScheme.onSurface,
),
],
),
),

View File

@ -278,7 +278,8 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
elevation: 0.0,
color: Theme.of(context).hoverColor,
child: Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(
vertical: 24, horizontal: 16),
// TODO: Reuse from fingerprint_dialog
child: Column(
children: [

View File

@ -442,7 +442,8 @@ class _FidoUnlockedPageState extends ConsumerState<_FidoUnlockedPage> {
elevation: 0.0,
color: Theme.of(context).hoverColor,
child: Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(
vertical: 24, horizontal: 16),
child: CredentialInfoTable(credential),
),
),

View File

@ -27,6 +27,7 @@ import '../../app/views/action_list.dart';
import '../../app/views/fs_dialog.dart';
import '../../core/models.dart';
import '../../core/state.dart';
import '../../widgets/tooltip_if_truncated.dart';
import '../features.dart' as features;
import '../models.dart';
import '../state.dart';
@ -132,26 +133,25 @@ class AccountDialog extends ConsumerWidget {
],
),
),
Text(
helper.title,
style: Theme.of(context).textTheme.headlineSmall,
softWrap: true,
textAlign: TextAlign.center,
TooltipIfTruncated(
text: helper.title,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.headlineSmall
?.fontSize),
),
if (subtitle != null)
Text(
subtitle,
softWrap: true,
textAlign: TextAlign.center,
TooltipIfTruncated(
text: subtitle,
// This is what ListTile uses for subtitle
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color: Theme.of(context)
.textTheme
.bodySmall!
.color,
.colorScheme
.onSurfaceVariant,
),
),
],

View File

@ -40,6 +40,7 @@ import '../../widgets/app_input_decoration.dart';
import '../../widgets/app_text_form_field.dart';
import '../../widgets/file_drop_overlay.dart';
import '../../widgets/list_title.dart';
import '../../widgets/tooltip_if_truncated.dart';
import '../features.dart' as features;
import '../keys.dart' as keys;
import '../models.dart';
@ -303,13 +304,11 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
elevation: 0.0,
color: Theme.of(context).hoverColor,
child: Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(
vertical: 24, horizontal: 16),
child: Column(
children: [
Padding(
padding:
const EdgeInsets.symmetric(vertical: 16),
child: Row(
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -325,28 +324,26 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
),
],
),
),
Text(
helper.title,
style:
Theme.of(context).textTheme.headlineSmall,
softWrap: true,
textAlign: TextAlign.center,
const SizedBox(height: 16),
TooltipIfTruncated(
text: helper.title,
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.headlineSmall
?.fontSize),
),
if (subtitle != null)
Text(
subtitle,
softWrap: true,
textAlign: TextAlign.center,
TooltipIfTruncated(
text: subtitle,
// This is what ListTile uses for subtitle
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color: Theme.of(context)
.textTheme
.bodySmall!
.color,
.colorScheme
.onSurfaceVariant,
),
),
],

View File

@ -109,7 +109,8 @@ class _OtpScreenState extends ConsumerState<OtpScreen> {
elevation: 0.0,
color: Theme.of(context).hoverColor,
child: Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(
vertical: 24, horizontal: 16.0),
// TODO: Reuse from fingerprint_dialog
child: Column(
children: [
@ -128,9 +129,19 @@ class _OtpScreenState extends ConsumerState<OtpScreen> {
size: 100.0,
),
const SizedBox(height: 8),
Text(selected.isConfigured
Text(
selected.isConfigured
? l10n.l_otp_slot_configured
: l10n.l_otp_slot_empty)
: l10n.l_otp_slot_empty,
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
),
)
],
),
),

View File

@ -63,7 +63,7 @@ class SlotDialog extends ConsumerWidget {
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 48, bottom: 16),
padding: const EdgeInsets.only(top: 48, bottom: 32),
child: Column(
children: [
Text(
@ -73,14 +73,24 @@ class SlotDialog extends ConsumerWidget {
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
const Icon(
Icon(
Symbols.touch_app,
size: 100.0,
color: Theme.of(context).colorScheme.onSurface,
),
const SizedBox(height: 8),
Text(otpSlot.isConfigured
Text(
otpSlot.isConfigured
? l10n.l_otp_slot_configured
: l10n.l_otp_slot_empty)
: l10n.l_otp_slot_empty,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant),
)
],
),
),

View File

@ -131,7 +131,8 @@ class _PivScreenState extends ConsumerState<PivScreen> {
elevation: 0.0,
color: Theme.of(context).hoverColor,
child: Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 24),
child: Column(
children: [
Text(
@ -149,7 +150,8 @@ class _PivScreenState extends ConsumerState<PivScreen> {
alwaysIncludePrivate:
pivState.supportsMetadata,
),
const SizedBox(height: 16),
if (selected.certInfo == null)
const SizedBox(height: 16)
],
if (selected.certInfo == null)
Text(

View File

@ -71,40 +71,38 @@ class SlotDialog extends ConsumerWidget {
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(top: 48, bottom: 16),
padding: const EdgeInsets.only(top: 48, bottom: 32),
child: Column(
children: [
Text(
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
pivSlot.getDisplayName(l10n),
style: textTheme.headlineSmall,
softWrap: true,
textAlign: TextAlign.center,
),
),
const SizedBox(height: 16.0),
Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
children: [
if (certInfo != null || metadata != null) ...[
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: CertInfoTable(
CertInfoTable(
certInfo,
metadata,
alwaysIncludePrivate:
pivState.supportsMetadata,
),
alwaysIncludePrivate: pivState.supportsMetadata,
),
if (certInfo == null) const SizedBox(height: 16),
],
if (certInfo == null) ...[
Padding(
padding: const EdgeInsets.only(bottom: 16),
child: Text(
Text(
l10n.l_no_certificate,
softWrap: true,
textAlign: TextAlign.center,
style: subtitleStyle,
),
),
],
],
),
@ -112,7 +110,6 @@ class SlotDialog extends ConsumerWidget {
],
),
),
const SizedBox(height: 16),
ActionListSection.fromMenuActions(
context,
l10n.s_actions,