mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 06:15:10 +00:00
design: Improve login UI
This commit is contained in:
parent
fcfe19889c
commit
4929858ae4
4 changed files with 40 additions and 49 deletions
|
@ -59,6 +59,7 @@ class HomeserverAppBar extends StatelessWidget {
|
|||
icon: const Icon(Icons.arrow_back),
|
||||
)
|
||||
: null,
|
||||
fillColor: Theme.of(context).colorScheme.onInverseSurface,
|
||||
prefixText: '${L10n.of(context)!.homeserver}: ',
|
||||
hintText: L10n.of(context)!.enterYourHomeserver,
|
||||
suffixIcon: const Icon(Icons.search),
|
||||
|
|
|
@ -21,10 +21,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
return LoginScaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 12,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: HomeserverAppBar(controller: controller),
|
||||
),
|
||||
title: HomeserverAppBar(controller: controller),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
|
@ -61,34 +58,6 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
'assets/info-logo.png',
|
||||
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) ...[
|
||||
const Center(
|
||||
child: Icon(
|
||||
|
@ -140,9 +109,8 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
height: 24,
|
||||
),
|
||||
),
|
||||
label: provider.name ??
|
||||
provider.brand ??
|
||||
L10n.of(context)!.singlesignon,
|
||||
label:
|
||||
'Sign in with ${provider.name ?? provider.brand ?? L10n.of(context)!.singlesignon}',
|
||||
onPressed: () =>
|
||||
controller.ssoLoginAction(provider.id!),
|
||||
),
|
||||
|
@ -156,14 +124,20 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Center(
|
||||
child: SizedBox(
|
||||
width: 256,
|
||||
child: TextButton(
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 12),
|
||||
),
|
||||
onPressed: controller.restoreBackup,
|
||||
child: Text(L10n.of(context)!.hydrate),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -191,14 +165,30 @@ class _LoginButton extends StatelessWidget {
|
|||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
margin: const EdgeInsets.only(bottom: 16),
|
||||
width: double.infinity,
|
||||
child: ElevatedButton.icon(
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
width: 256,
|
||||
child: OutlinedButton(
|
||||
style: OutlinedButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(90),
|
||||
),
|
||||
foregroundColor: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
label: Text(label),
|
||||
child: Row(
|
||||
children: [
|
||||
icon,
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Text(
|
||||
label,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class LoginScaffold extends StatelessWidget {
|
|||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 64),
|
||||
const SizedBox(height: 16),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Padding(
|
||||
|
|
|
@ -60,7 +60,7 @@ static void my_application_activate(GApplication* application) {
|
|||
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();
|
||||
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
|
||||
|
|
Loading…
Reference in a new issue