From 2f6b1278fe59971855e9772de7e60961abf3a29e Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 7 Nov 2022 16:30:17 -0600 Subject: [PATCH] swb desktop layout tweaks --- .../create_backup_view.dart | 4 +- .../restore_from_file_view.dart | 4 +- .../backup_and_restore_settings.dart | 192 ++++++++++-------- .../enable_backup_dialog.dart | 3 +- 4 files changed, 115 insertions(+), 88 deletions(-) diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart index 2d2ed4960..30fcb7962 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart @@ -157,7 +157,7 @@ class _RestoreFromFileViewState extends State { .textDark3), ), ), - // child, + child, const SizedBox(height: 20), Row( children: [ @@ -442,7 +442,7 @@ class _RestoreFromFileViewState extends State { const SizedBox( height: 16, ), - const Spacer(), + if (!isDesktop) const Spacer(), TextButton( style: shouldEnableCreate ? Theme.of(context) diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart index 9f2796415..0c101d0b3 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart @@ -142,7 +142,7 @@ class _RestoreFromFileViewState extends ConsumerState { textAlign: TextAlign.left, ), ), - // child, + child, const SizedBox(height: 20), Row( children: [ @@ -285,7 +285,7 @@ class _RestoreFromFileViewState extends ConsumerState { const SizedBox( height: 16, ), - const Spacer(), + if (!isDesktop) const Spacer(), TextButton( style: passwordController.text.isEmpty || fileLocationController.text.isEmpty diff --git a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart index b59206f17..49debf22f 100644 --- a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart +++ b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/backup_and_restore_settings.dart @@ -64,48 +64,56 @@ class _BackupRestoreSettings extends ConsumerState { height: 48, ), Center( - child: Padding( - padding: const EdgeInsets.all(10), - child: RichText( - textAlign: TextAlign.start, - text: TextSpan( - children: [ - TextSpan( - text: "Auto Backup", - style: - STextStyles.desktopTextSmall(context), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(10), + child: RichText( + textAlign: TextAlign.start, + text: TextSpan( + children: [ + TextSpan( + text: "Auto Backup", + style: STextStyles.desktopTextSmall( + context), + ), + TextSpan( + text: + "\n\nAuto backup is a custom Stack Wallet feature that offers a convenient backup of your data." + "To ensure maximum security, we recommend using a unique password that you haven't used anywhere " + "else on the internet before. Your password is not stored.", + style: STextStyles + .desktopTextExtraExtraSmall( + context), + ), + TextSpan( + text: + "\n\nFor more information, please see our website ", + style: STextStyles + .desktopTextExtraExtraSmall( + context), + ), + TextSpan( + text: "stackwallet.com", + style: STextStyles.richLink(context) + .copyWith(fontSize: 14), + recognizer: TapGestureRecognizer() + ..onTap = () { + launchUrl( + Uri.parse( + "https://stackwallet.com/"), + mode: LaunchMode + .externalApplication, + ); + }, + ), + ], + ), ), - TextSpan( - text: - "\n\nAuto backup is a custom Stack Wallet feature that offers a convenient backup of your data." - "To ensure maximum security, we recommend using a unique password that you haven't used anywhere " - "else on the internet before. Your password is not stored.", - style: STextStyles - .desktopTextExtraExtraSmall(context), - ), - TextSpan( - text: - "\n\nFor more information, please see our website ", - style: STextStyles - .desktopTextExtraExtraSmall(context), - ), - TextSpan( - text: "stackwallet.com", - style: STextStyles.richLink(context) - .copyWith(fontSize: 14), - recognizer: TapGestureRecognizer() - ..onTap = () { - launchUrl( - Uri.parse( - "https://stackwallet.com/"), - mode: - LaunchMode.externalApplication, - ); - }, - ), - ], + ), ), - ), + ], ), ), Column( @@ -148,39 +156,49 @@ class _BackupRestoreSettings extends ConsumerState { alignment: Alignment.topLeft, ), Center( - child: Padding( - padding: const EdgeInsets.all(10), - child: RichText( - textAlign: TextAlign.start, - text: TextSpan( - children: [ - TextSpan( - text: "Manual Backup", - style: - STextStyles.desktopTextSmall(context), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(10), + child: RichText( + textAlign: TextAlign.start, + text: TextSpan( + children: [ + TextSpan( + text: "Manual Backup", + style: STextStyles.desktopTextSmall( + context), + ), + TextSpan( + text: + "\n\nCreate manual backup to easily transfer your data between devices. " + "You will create a backup file that can be later used in the Restore option. " + "Use a strong password to encrypt your data.", + style: STextStyles + .desktopTextExtraExtraSmall( + context), + ), + ], + ), ), - TextSpan( - text: - "\n\nCreate manual backup to easily transfer your data between devices. " - "You will create a backup file that can be later used in the Restore option. " - "Use a strong password to encrypt your data.", - style: STextStyles - .desktopTextExtraExtraSmall(context), - ), - ], + ), ), - ), + ], ), ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.all( + padding: const EdgeInsets.all( 10, ), child: createBackup - ? const CreateBackupView() + ? const SizedBox( + width: 512, + child: CreateBackupView(), + ) : PrimaryButton( desktopMed: true, width: 200, @@ -217,27 +235,34 @@ class _BackupRestoreSettings extends ConsumerState { alignment: Alignment.topLeft, ), Center( - child: Padding( - padding: const EdgeInsets.all(10), - child: RichText( - textAlign: TextAlign.start, - text: TextSpan( - children: [ - TextSpan( - text: "Restore Backup", - style: - STextStyles.desktopTextSmall(context), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(10), + child: RichText( + textAlign: TextAlign.start, + text: TextSpan( + children: [ + TextSpan( + text: "Restore Backup", + style: STextStyles.desktopTextSmall( + context), + ), + TextSpan( + text: + "\n\nUse your Stack Wallet backup file to restore your wallets, address book " + "and wallet preferences.", + style: STextStyles + .desktopTextExtraExtraSmall( + context), + ), + ], + ), ), - TextSpan( - text: - "\n\nUse your Stack Wallet backup file to restore your wallets, address book " - "and wallet preferences.", - style: STextStyles - .desktopTextExtraExtraSmall(context), - ), - ], + ), ), - ), + ], ), ), Column( @@ -248,7 +273,10 @@ class _BackupRestoreSettings extends ConsumerState { 10, ), child: restoreBackup - ? RestoreFromFileView() + ? const SizedBox( + width: 512, + child: RestoreFromFileView(), + ) : PrimaryButton( desktopMed: true, width: 200, diff --git a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart index 046d136a8..963fb4441 100644 --- a/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart +++ b/lib/pages_desktop_specific/home/settings_menu/backup_and_restore/enable_backup_dialog.dart @@ -61,8 +61,7 @@ class EnableBackupDialog extends StatelessWidget { child: SecondaryButton( label: "Cancel", onPressed: () { - int count = 0; - Navigator.of(context).popUntil((_) => count++ >= 2); + Navigator.of(context).pop(); }, ), ),