Skip to content

Commit

Permalink
Fix dialog background colors (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansen4857 authored Jan 2, 2025
1 parent 86e9d15 commit c6e1d53
Show file tree
Hide file tree
Showing 11 changed files with 215 additions and 131 deletions.
7 changes: 7 additions & 0 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
context: this.context,
barrierDismissible: false,
builder: (context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;

return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('New Field Image Available'),
content: const SizedBox(
width: 400,
Expand Down Expand Up @@ -187,7 +191,10 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
context: this.context,
barrierDismissible: false,
builder: (context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Non-standard Field Mirroring'),
content: const SizedBox(
width: 300,
Expand Down
3 changes: 3 additions & 0 deletions lib/pages/nav_grid_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ class _NavGridPageState extends State<NavGridPage> {
showDialog(
context: this.context,
builder: (context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Edit Grid'),
content: SizedBox(
width: 350,
Expand Down
3 changes: 3 additions & 0 deletions lib/pages/project/project_item_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ class _ProjectItemCardState extends State<ProjectItemCard> {
showDialog(
context: context,
builder: (context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Delete File'),
content: Text(
'Are you sure you want to delete the file: ${widget.name}? This cannot be undone.\n\nIf this is a path, any autos using it will have their reference to it removed.'),
Expand Down
31 changes: 31 additions & 0 deletions lib/pages/project/project_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,18 @@ class _ProjectPageState extends State<ProjectPage> {
context: context,
builder: (BuildContext
context) {
ColorScheme
colorScheme =
Theme.of(
context)
.colorScheme;
return AlertDialog(
backgroundColor:
colorScheme
.surface,
surfaceTintColor:
colorScheme
.surfaceTint,
title: const Text(
'Unable to Rename'),
content: Text(
Expand Down Expand Up @@ -1052,7 +1063,10 @@ class _ProjectPageState extends State<ProjectPage> {
showDialog(
context: context,
builder: (BuildContext context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Unable to Rename'),
content: Text('The file "$newName.path" already exists'),
actions: [
Expand Down Expand Up @@ -1300,7 +1314,18 @@ class _ProjectPageState extends State<ProjectPage> {
context: context,
builder: (BuildContext
context) {
ColorScheme
colorScheme =
Theme.of(
context)
.colorScheme;
return AlertDialog(
backgroundColor:
colorScheme
.surface,
surfaceTintColor:
colorScheme
.surfaceTint,
title: const Text(
'Unable to Rename'),
content: Text(
Expand Down Expand Up @@ -1524,7 +1549,10 @@ class _ProjectPageState extends State<ProjectPage> {
showDialog(
context: this.context,
builder: (context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Delete Folder'),
content: SizedBox(
width: 400,
Expand Down Expand Up @@ -1787,7 +1815,10 @@ class _ProjectPageState extends State<ProjectPage> {
showDialog(
context: context,
builder: (BuildContext context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Unable to Rename'),
content: Text('The file "$newName.auto" already exists'),
actions: [
Expand Down
9 changes: 9 additions & 0 deletions lib/widgets/app_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ class _AppSettingsState extends State<AppSettings> {
showDialog(
context: context,
builder: (context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Delete Custom Field Image'),
content: Text(
'Are you sure you want to delete the custom field "${_selectedField.name}"? This cannot be undone.'),
Expand Down Expand Up @@ -472,7 +475,10 @@ class _AppSettingsState extends State<AppSettings> {
context: context,
barrierColor: Colors.transparent,
builder: (BuildContext context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Pick Theme Color'),
content: Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
Expand Down Expand Up @@ -534,10 +540,13 @@ class _AppSettingsState extends State<AppSettings> {
showDialog(
context: context,
builder: (BuildContext context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return KeyBoardShortcuts(
keysToPress: {LogicalKeyboardKey.enter},
onKeysPressed: () => Navigator.of(context).pop(),
child: AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Failed to Import Field'),
content:
Text('Field with the name "$name" already exists.'),
Expand Down
3 changes: 3 additions & 0 deletions lib/widgets/dialogs/edit_field_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ class _EditFieldDialogState extends State<EditFieldDialog> {

@override
Widget build(BuildContext context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
return KeyBoardShortcuts(
keysToPress: {LogicalKeyboardKey.enter},
onKeysPressed: () => confirm(context),
child: AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Edit Custom Field'),
content: Column(
mainAxisSize: MainAxisSize.min,
Expand Down
2 changes: 2 additions & 0 deletions lib/widgets/dialogs/import_field_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class _ImportFieldDialogState extends State<ImportFieldDialog> {
keysToPress: {LogicalKeyboardKey.enter},
onKeysPressed: () => confirm(context),
child: AlertDialog(
backgroundColor: colorScheme.surface,
surfaceTintColor: colorScheme.surfaceTint,
title: const Text('Import Custom Field'),
content: Column(
mainAxisSize: MainAxisSize.min,
Expand Down
Loading

0 comments on commit c6e1d53

Please sign in to comment.