design: Improve login UI

This commit is contained in:
krille-chan 2023-07-22 13:00:27 +02:00
parent fcfe19889c
commit 4929858ae4
No known key found for this signature in database
4 changed files with 40 additions and 49 deletions

View file

@ -59,6 +59,7 @@ class HomeserverAppBar extends StatelessWidget {
icon: const Icon(Icons.arrow_back), icon: const Icon(Icons.arrow_back),
) )
: null, : null,
fillColor: Theme.of(context).colorScheme.onInverseSurface,
prefixText: '${L10n.of(context)!.homeserver}: ', prefixText: '${L10n.of(context)!.homeserver}: ',
hintText: L10n.of(context)!.enterYourHomeserver, hintText: L10n.of(context)!.enterYourHomeserver,
suffixIcon: const Icon(Icons.search), suffixIcon: const Icon(Icons.search),

View file

@ -21,10 +21,7 @@ class HomeserverPickerView extends StatelessWidget {
return LoginScaffold( return LoginScaffold(
appBar: AppBar( appBar: AppBar(
titleSpacing: 12, titleSpacing: 12,
title: Padding( title: HomeserverAppBar(controller: controller),
padding: const EdgeInsets.all(0.0),
child: HomeserverAppBar(controller: controller),
),
), ),
body: SafeArea( body: SafeArea(
child: Column( child: Column(
@ -61,34 +58,6 @@ class HomeserverPickerView extends StatelessWidget {
'assets/info-logo.png', 'assets/info-logo.png',
height: 96, height: 96,
), ),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Row(
children: [
Expanded(
child: Divider(
thickness: 1,
height: 1,
color: Theme.of(context).dividerColor,
),
),
Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
L10n.of(context)!.continueWith,
style: const TextStyle(fontSize: 12),
),
),
Expanded(
child: Divider(
thickness: 1,
height: 1,
color: Theme.of(context).dividerColor,
),
),
],
),
),
if (errorText != null) ...[ if (errorText != null) ...[
const Center( const Center(
child: Icon( child: Icon(
@ -140,9 +109,8 @@ class HomeserverPickerView extends StatelessWidget {
height: 24, height: 24,
), ),
), ),
label: provider.name ?? label:
provider.brand ?? 'Sign in with ${provider.name ?? provider.brand ?? L10n.of(context)!.singlesignon}',
L10n.of(context)!.singlesignon,
onPressed: () => onPressed: () =>
controller.ssoLoginAction(provider.id!), controller.ssoLoginAction(provider.id!),
), ),
@ -156,12 +124,18 @@ class HomeserverPickerView extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
child: TextButton( child: Center(
style: TextButton.styleFrom( child: SizedBox(
padding: const EdgeInsets.symmetric(vertical: 12), width: 256,
child: TextButton(
style: TextButton.styleFrom(
padding:
const EdgeInsets.symmetric(vertical: 12),
),
onPressed: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
),
), ),
onPressed: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
), ),
), ),
], ],
@ -191,14 +165,30 @@ class _LoginButton extends StatelessWidget {
return Container( return Container(
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
margin: const EdgeInsets.only(bottom: 16), margin: const EdgeInsets.only(bottom: 16),
width: double.infinity, alignment: Alignment.center,
child: ElevatedButton.icon( child: SizedBox(
style: ElevatedButton.styleFrom( width: 256,
padding: const EdgeInsets.symmetric(vertical: 12), child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(90),
),
foregroundColor: Theme.of(context).colorScheme.onBackground,
),
onPressed: onPressed,
child: Row(
children: [
icon,
const SizedBox(width: 16),
Expanded(
child: Text(
label,
overflow: TextOverflow.ellipsis,
),
),
],
),
), ),
onPressed: onPressed,
icon: icon,
label: Text(label),
), ),
); );
} }

View file

@ -54,7 +54,7 @@ class LoginScaffold extends StatelessWidget {
), ),
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 64), const SizedBox(height: 16),
Expanded( Expanded(
child: Center( child: Center(
child: Padding( child: Padding(

View file

@ -60,7 +60,7 @@ static void my_application_activate(GApplication* application) {
gtk_window_set_title(window, "fluffychat"); gtk_window_set_title(window, "fluffychat");
} }
gtk_window_set_default_size(window, 864, 600); gtk_window_set_default_size(window, 864, 680);
g_autoptr(FlDartProject) project = fl_dart_project_new(); g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);