diff --git a/assets/banner_transparent.png b/assets/banner_transparent.png new file mode 100644 index 00000000..7e576c6f Binary files /dev/null and b/assets/banner_transparent.png differ diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 6f7da6d7..6fc671b2 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2985,5 +2985,6 @@ "endToEndEncryption": "End to end encryption", "disableEncryptionWarning": "For security reasons you can not disable encryption in a chat, where it has been enabled before.", "sorryThatsNotPossible": "Sorry... that is not possible", - "deviceKeys": "Device keys:" + "deviceKeys": "Device keys:", + "letsStart": "Let's start" } diff --git a/lib/pages/connect/connect_page_view.dart b/lib/pages/connect/connect_page_view.dart index d1063926..8bc928ec 100644 --- a/lib/pages/connect/connect_page_view.dart +++ b/lib/pages/connect/connect_page_view.dart @@ -40,9 +40,12 @@ class ConnectPageView extends StatelessWidget { elevation: Theme.of(context) .appBarTheme .scrolledUnderElevation ?? - 4, + 10, color: Colors.transparent, - shadowColor: Theme.of(context).appBarTheme.shadowColor, + shadowColor: Theme.of(context) + .colorScheme + .onBackground + .withAlpha(64), clipBehavior: Clip.hardEdge, child: CircleAvatar( radius: 64, @@ -103,13 +106,14 @@ class ConnectPageView extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Hero( tag: 'loginButton', - child: ElevatedButton( + child: ElevatedButton.icon( style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.primary, foregroundColor: Theme.of(context).colorScheme.onPrimary, ), onPressed: controller.loading ? () {} : controller.signUp, - child: controller.loading + icon: const Icon(Icons.person_add_outlined), + label: controller.loading ? const LinearProgressIndicator() : Text(L10n.of(context)!.signUp), ), @@ -198,7 +202,8 @@ class ConnectPageView extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Hero( tag: 'signinButton', - child: ElevatedButton( + child: ElevatedButton.icon( + icon: const Icon(Icons.login_outlined), style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.primaryContainer, @@ -206,7 +211,7 @@ class ConnectPageView extends StatelessWidget { Theme.of(context).colorScheme.onPrimaryContainer, ), onPressed: controller.loading ? () {} : controller.login, - child: Text(L10n.of(context)!.login), + label: Text(L10n.of(context)!.login), ), ), ), diff --git a/lib/pages/homeserver_picker/homeserver_picker_view.dart b/lib/pages/homeserver_picker/homeserver_picker_view.dart index b91dbe76..4ea3a20e 100644 --- a/lib/pages/homeserver_picker/homeserver_picker_view.dart +++ b/lib/pages/homeserver_picker/homeserver_picker_view.dart @@ -48,75 +48,68 @@ class HomeserverPickerView extends StatelessWidget { ), ), Expanded( - child: ListView( - children: [ - if (controller.displayServerList) - Padding( - padding: const EdgeInsets.all(12.0), - child: Material( - borderRadius: - BorderRadius.circular(AppConfig.borderRadius), - color: Theme.of(context).colorScheme.onInverseSurface, - clipBehavior: Clip.hardEdge, - child: benchmarkResults == null - ? const Center( - child: Padding( - padding: EdgeInsets.all(12.0), - child: CircularProgressIndicator.adaptive(), - )) - : Column( - children: controller.filteredHomeservers - .map( - (server) => ListTile( - trailing: IconButton( - icon: const Icon( - Icons.info_outlined, - color: Colors.black, - ), - onPressed: () => - controller.showServerInfo(server), - ), - onTap: () => controller.setServer( - server.homeserver.baseUrl.host), - title: Text( - server.homeserver.baseUrl.host, - style: const TextStyle( - color: Colors.black), - ), - subtitle: Text( - server.homeserver.description ?? '', - style: TextStyle( - color: Colors.grey.shade700), - ), - ), - ) - .toList(), - ), - ), + child: controller.displayServerList + ? ListView( + children: [ + if (controller.displayServerList) + Padding( + padding: const EdgeInsets.all(12.0), + child: Material( + borderRadius: + BorderRadius.circular(AppConfig.borderRadius), + color: Theme.of(context) + .colorScheme + .onInverseSurface, + clipBehavior: Clip.hardEdge, + child: benchmarkResults == null + ? const Center( + child: Padding( + padding: EdgeInsets.all(12.0), + child: + CircularProgressIndicator.adaptive(), + )) + : Column( + children: controller.filteredHomeservers + .map( + (server) => ListTile( + trailing: IconButton( + icon: const Icon( + Icons.info_outlined, + color: Colors.black, + ), + onPressed: () => controller + .showServerInfo(server), + ), + onTap: () => controller.setServer( + server + .homeserver.baseUrl.host), + title: Text( + server.homeserver.baseUrl.host, + style: const TextStyle( + color: Colors.black), + ), + subtitle: Text( + server.homeserver.description ?? + '', + style: TextStyle( + color: + Colors.grey.shade700), + ), + ), + ) + .toList(), + ), + ), + ), + ], ) - else ...[ - Container( - alignment: Alignment.center, - height: 200, + : Container( + alignment: Alignment.topCenter, child: Image.asset( - 'assets/info-logo.png', + 'assets/banner_transparent.png', filterQuality: FilterQuality.medium, ), ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Center( - child: Text( - AppConfig.applicationWelcomeMessage ?? - L10n.of(context)!.welcomeText, - textAlign: TextAlign.center, - style: const TextStyle(fontSize: 20), - ), - ), - ), - ], - ], - ), ), SafeArea( child: Container( @@ -126,21 +119,17 @@ class HomeserverPickerView extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - TextButton( - style: TextButton.styleFrom( - foregroundColor: - Theme.of(context).colorScheme.onSurfaceVariant, - ), - onPressed: controller.restoreBackup, - child: Text(L10n.of(context)!.hydrate), - ), TextButton( onPressed: () => launch(AppConfig.privacyUrl), child: Text(L10n.of(context)!.privacy), ), + TextButton( + onPressed: controller.restoreBackup, + child: Text(L10n.of(context)!.hydrate), + ), Hero( tag: 'loginButton', - child: ElevatedButton( + child: ElevatedButton.icon( style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.primary, @@ -150,9 +139,10 @@ class HomeserverPickerView extends StatelessWidget { onPressed: controller.isLoading ? null : controller.checkHomeserverAction, - child: controller.isLoading + icon: const Icon(Icons.start_outlined), + label: controller.isLoading ? const LinearProgressIndicator() - : Text(L10n.of(context)!.connect), + : Text(L10n.of(context)!.letsStart), ), ), ], diff --git a/lib/pages/login/login_view.dart b/lib/pages/login/login_view.dart index a2b1afc8..158b4912 100644 --- a/lib/pages/login/login_view.dart +++ b/lib/pages/login/login_view.dart @@ -82,7 +82,7 @@ class LoginView extends StatelessWidget { tag: 'signinButton', child: Padding( padding: const EdgeInsets.all(12.0), - child: ElevatedButton( + child: ElevatedButton.icon( style: ElevatedButton.styleFrom( backgroundColor: Theme.of(context).colorScheme.primary, foregroundColor: Theme.of(context).colorScheme.onPrimary, @@ -90,7 +90,8 @@ class LoginView extends StatelessWidget { onPressed: controller.loading ? null : () => controller.login(context), - child: controller.loading + icon: const Icon(Icons.login_outlined), + label: controller.loading ? const LinearProgressIndicator() : Text(L10n.of(context)!.login), ), @@ -124,14 +125,15 @@ class LoginView extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(12.0), - child: ElevatedButton( + child: ElevatedButton.icon( onPressed: controller.loading ? () {} : controller.passwordForgotten, style: ElevatedButton.styleFrom( foregroundColor: Theme.of(context).colorScheme.error, backgroundColor: Theme.of(context).colorScheme.onError, ), - child: Text(L10n.of(context)!.passwordForgotten), + icon: const Icon(Icons.safety_check_outlined), + label: Text(L10n.of(context)!.passwordForgotten), ), ), ], diff --git a/lib/pages/sign_up/signup_view.dart b/lib/pages/sign_up/signup_view.dart index 1fbeede3..698cff44 100644 --- a/lib/pages/sign_up/signup_view.dart +++ b/lib/pages/sign_up/signup_view.dart @@ -94,13 +94,14 @@ class SignupPageView extends StatelessWidget { tag: 'loginButton', child: Padding( padding: const EdgeInsets.all(12), - child: ElevatedButton( + child: ElevatedButton.icon( + icon: const Icon(Icons.person_add_outlined), style: ElevatedButton.styleFrom( foregroundColor: Theme.of(context).colorScheme.onPrimary, backgroundColor: Theme.of(context).colorScheme.primary, ), onPressed: controller.loading ? () {} : controller.signup, - child: controller.loading + label: controller.loading ? const LinearProgressIndicator() : Text(L10n.of(context)!.signUp), ), diff --git a/lib/widgets/layouts/login_scaffold.dart b/lib/widgets/layouts/login_scaffold.dart index 69d96807..606b93e7 100644 --- a/lib/widgets/layouts/login_scaffold.dart +++ b/lib/widgets/layouts/login_scaffold.dart @@ -43,21 +43,20 @@ class LoginScaffold extends StatelessWidget { ), ), child: Center( - child: Material( - color: Theme.of(context).brightness == Brightness.light - ? Theme.of(context).scaffoldBackgroundColor.withOpacity(0.9) - : Theme.of(context).scaffoldBackgroundColor.withOpacity(0.75), - borderRadius: isMobileMode - ? null - : BorderRadius.circular(AppConfig.borderRadius), - elevation: isMobileMode ? 0 : 10, - clipBehavior: Clip.hardEdge, - shadowColor: Colors.black, - child: ConstrainedBox( - constraints: isMobileMode - ? const BoxConstraints() - : const BoxConstraints(maxWidth: 480, maxHeight: 640), - child: scaffold, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Material( + color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.925), + borderRadius: BorderRadius.circular(AppConfig.borderRadius), + clipBehavior: Clip.hardEdge, + elevation: 10, + shadowColor: Colors.black, + child: ConstrainedBox( + constraints: isMobileMode + ? const BoxConstraints() + : const BoxConstraints(maxWidth: 480, maxHeight: 640), + child: scaffold, + ), ), ), ),