Skip to content

Commit

Permalink
accessiblity: Add padding to SimpleDialogOption
Browse files Browse the repository at this point in the history
  • Loading branch information
calcitem committed Apr 23, 2024
1 parent 07bfa70 commit c823fe2
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,21 @@ class _GameOptionsModal extends StatelessWidget {
await showRestartGameAlertDialog(context);
}
},
child: Text(S.of(context).newGame),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).newGame),
),
),
const CustomSpacer(),
if (!kIsWeb &&
(GameController().gameRecorder.hasPrevious == true ||
GameController().isPositionSetup == true))
SimpleDialogOption(
onPressed: () => GameController.save(context),
child: Text(S.of(context).saveGame),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).saveGame),
),
),
if (!kIsWeb &&
(GameController().gameRecorder.hasPrevious == true ||
Expand All @@ -91,13 +97,19 @@ class _GameOptionsModal extends StatelessWidget {
if (!kIsWeb)
SimpleDialogOption(
onPressed: () => GameController.load(context),
child: Text(S.of(context).loadGame),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).loadGame),
),
),
const CustomSpacer(),
if (!kIsWeb)
SimpleDialogOption(
onPressed: () => GameController.import(context),
child: Text(S.of(context).importGame),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).importGame),
),
),
if (!kIsWeb &&
(GameController().gameRecorder.hasPrevious == true ||
Expand All @@ -108,7 +120,10 @@ class _GameOptionsModal extends StatelessWidget {
GameController().isPositionSetup == true))
SimpleDialogOption(
onPressed: () => GameController.export(context),
child: Text(S.of(context).exportGame),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).exportGame),
),
),
// TODO: Fix iOS bug
if (DB().generalSettings.gameScreenRecorderSupport && !Platform.isIOS)
Expand All @@ -119,13 +134,19 @@ class _GameOptionsModal extends StatelessWidget {
GameController().gifShare(context);
Navigator.pop(context);
},
child: Text(S.of(context).shareGIF),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).shareGIF),
),
),
if (DB().generalSettings.screenReaderSupport) const CustomSpacer(),
if (DB().generalSettings.screenReaderSupport)
SimpleDialogOption(
onPressed: () => Navigator.pop(context),
child: Text(S.of(context).close),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).close),
),
),
],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,45 @@ class _MoveOptionsModal extends StatelessWidget {
if (!DB().displaySettings.isHistoryNavigationToolbarShown) ...<Widget>[
SimpleDialogOption(
onPressed: () => HistoryNavigator.takeBack(context),
child: Text(S.of(context).takeBack),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).takeBack),
),
),
const CustomSpacer(),
SimpleDialogOption(
onPressed: () => HistoryNavigator.stepForward(context),
child: Text(S.of(context).stepForward),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).stepForward),
),
),
const CustomSpacer(),
SimpleDialogOption(
onPressed: () => HistoryNavigator.takeBackAll(context),
child: Text(S.of(context).takeBackAll),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).takeBackAll),
),
),
const CustomSpacer(),
SimpleDialogOption(
onPressed: () => HistoryNavigator.stepForwardAll(context),
child: Text(S.of(context).stepForwardAll),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).stepForwardAll),
),
),
const CustomSpacer(),
],
if (GameController().gameRecorder.hasPrevious ||
GameController().isPositionSetup == true) ...<Widget>[
SimpleDialogOption(
onPressed: () => _showMoveList(context),
child: Text(S.of(context).showMoveList),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).showMoveList),
),
),
const CustomSpacer(),
],
Expand All @@ -71,12 +86,18 @@ class _MoveOptionsModal extends StatelessWidget {
GameController().moveNow(context);
Navigator.pop(context);
},
child: Text(S.of(context).moveNow),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).moveNow),
),
),
const CustomSpacer(),
if (DB().generalSettings.screenReaderSupport)
SimpleDialogOption(
child: Text(S.of(context).close),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
child: Text(S.of(context).close),
),
onPressed: () => Navigator.pop(context),
),
],
Expand Down

0 comments on commit c823fe2

Please sign in to comment.