refactor(accessibility): improve patch options (#1369)

Co-authored-by: Palm <palmpasuthorn@gmail.com>
This commit is contained in:
Pun Butrach 2023-10-16 16:47:59 +07:00 committed by GitHub
parent b355778a92
commit ccc6be1e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,7 @@
{ {
"okButton": "OK", "okButton": "OK",
"cancelButton": "Cancel", "cancelButton": "Cancel",
"dismissButton": "Dismiss",
"quitButton": "Quit", "quitButton": "Quit",
"updateButton": "Update", "updateButton": "Update",
"enabledLabel": "Enabled", "enabledLabel": "Enabled",
@ -134,6 +135,7 @@
"setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing." "setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing."
}, },
"patchOptionsView": { "patchOptionsView": {
"resetOptionsTooltip": "Reset patch options",
"viewTitle": "Patch options", "viewTitle": "Patch options",
"saveOptions": "Save", "saveOptions": "Save",

View File

@ -48,6 +48,10 @@ class PatchOptionsView extends StatelessWidget {
icon: const Icon( icon: const Icon(
Icons.history, Icons.history,
), ),
tooltip: FlutterI18n.translate(
context,
'patchOptionsView.resetOptionsTooltip',
),
), ),
], ],
), ),

View File

@ -147,7 +147,7 @@ class PatchOptionsViewModel extends BaseViewModel {
), ),
actions: [ actions: [
CustomMaterialButton( CustomMaterialButton(
label: I18nText('okButton'), label: I18nText('cancelButton'),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@ -165,7 +165,7 @@ class PatchOptionsViewModel extends BaseViewModel {
.map((e) { .map((e) {
return CustomCard( return CustomCard(
padding: const EdgeInsets.all(4), padding: const EdgeInsets.all(4),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer, backgroundColor: Theme.of(context).colorScheme.surface,
onTap: () { onTap: () {
addOption(e); addOption(e);
Navigator.pop(context); Navigator.pop(context);
@ -186,9 +186,9 @@ class PatchOptionsViewModel extends BaseViewModel {
e.description, e.description,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Theme.of(context).colorScheme.onSecondaryContainer, color: Theme.of(context).colorScheme.onSurface,
), ),
) ),
], ],
), ),
), ),