fix: minor homeserver picker UI issues

- missing safe area preventing from choosing homeserver on notch devices
- low-accent black on grey

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2022-12-24 19:46:36 +01:00
parent bb74754851
commit 68d45f825f
2 changed files with 35 additions and 23 deletions

View File

@ -13,25 +13,31 @@ class HomeserverAppBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return TextField( return Material(
focusNode: controller.homeserverFocusNode, color: Theme.of(context).appBarTheme.backgroundColor,
controller: controller.homeserverController, child: SafeArea(
onChanged: controller.onChanged, bottom: false,
decoration: InputDecoration( child: TextField(
prefixIcon: Navigator.of(context).canPop() focusNode: controller.homeserverFocusNode,
? IconButton( controller: controller.homeserverController,
onPressed: Navigator.of(context).pop, onChanged: controller.onChanged,
icon: const Icon(Icons.arrow_back), decoration: InputDecoration(
) prefixIcon: Navigator.of(context).canPop()
: null, ? IconButton(
prefixText: '${L10n.of(context)!.homeserver}: ', onPressed: Navigator.of(context).pop,
hintText: L10n.of(context)!.enterYourHomeserver, icon: const Icon(Icons.arrow_back),
suffixIcon: const Icon(Icons.search), )
errorText: controller.error, : null,
prefixText: '${L10n.of(context)!.homeserver}: ',
hintText: L10n.of(context)!.enterYourHomeserver,
suffixIcon: const Icon(Icons.search),
errorText: controller.error,
),
readOnly: !AppConfig.allowOtherHomeservers,
onSubmitted: (_) => controller.checkHomeserverAction(),
autocorrect: false,
),
), ),
readOnly: !AppConfig.allowOtherHomeservers,
onSubmitted: (_) => controller.checkHomeserverAction(),
autocorrect: false,
); );
} }
} }

View File

@ -69,9 +69,11 @@ class HomeserverPickerView extends StatelessWidget {
.map( .map(
(server) => ListTile( (server) => ListTile(
trailing: IconButton( trailing: IconButton(
icon: const Icon( icon: Icon(
Icons.info_outlined, Icons.info_outlined,
color: Colors.black, color: Theme.of(context)
.colorScheme
.secondary,
), ),
onPressed: () => onPressed: () =>
controller.showServerInfo(server), controller.showServerInfo(server),
@ -80,13 +82,17 @@ class HomeserverPickerView extends StatelessWidget {
server.homeserver.baseUrl.host), server.homeserver.baseUrl.host),
title: Text( title: Text(
server.homeserver.baseUrl.host, server.homeserver.baseUrl.host,
style: const TextStyle( style: TextStyle(
color: Colors.black), color: Theme.of(context)
.colorScheme
.secondary,
),
), ),
subtitle: Text( subtitle: Text(
server.homeserver.description ?? '', server.homeserver.description ?? '',
style: TextStyle( style: TextStyle(
color: Colors.grey.shade700), color: Colors.grey.shade700,
),
), ),
), ),
) )