From d0679757b18fb04607bbe575019e53eac5953dc0 Mon Sep 17 00:00:00 2001 From: ashuntu Date: Tue, 10 Dec 2024 17:16:41 -0600 Subject: [PATCH] Fix RadioTile background and border colors --- .../landscape_skip/landscape_skip_page.dart | 1 + .../lib/pages/widgets/radio_tile.dart | 43 +++++++++++++------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/gui/packages/ubuntupro/lib/pages/landscape_skip/landscape_skip_page.dart b/gui/packages/ubuntupro/lib/pages/landscape_skip/landscape_skip_page.dart index 0ab232067..f4ca6b22a 100644 --- a/gui/packages/ubuntupro/lib/pages/landscape_skip/landscape_skip_page.dart +++ b/gui/packages/ubuntupro/lib/pages/landscape_skip/landscape_skip_page.dart @@ -51,6 +51,7 @@ class _LandscapeSkipPageState extends State { groupValue = v!; }), ), + const SizedBox(height: 16), RadioTile( value: SkipEnum.register, title: lang.landscapeSkipRegister, diff --git a/gui/packages/ubuntupro/lib/pages/widgets/radio_tile.dart b/gui/packages/ubuntupro/lib/pages/widgets/radio_tile.dart index 6220ca6a3..02da0ea4f 100644 --- a/gui/packages/ubuntupro/lib/pages/widgets/radio_tile.dart +++ b/gui/packages/ubuntupro/lib/pages/widgets/radio_tile.dart @@ -19,18 +19,37 @@ class RadioTile extends StatelessWidget { @override Widget build(BuildContext context) { // Adds a nice visual clue that the tile is selected. - return YaruSelectableContainer( - selected: groupValue == value, - selectionColor: Theme.of(context).colorScheme.tertiaryContainer, - child: YaruRadioListTile( - contentPadding: EdgeInsets.zero, - visualDensity: VisualDensity.comfortable, - dense: true, - title: Text(title), - subtitle: subtitle != null ? Text(subtitle!) : null, - value: value, - groupValue: groupValue, - onChanged: onChanged, + return YaruBorderContainer( + border: groupValue == value + ? Border.all( + color: Theme.of(context).colorScheme.primary, + ) + : null, + // we specify this here since [YaruSelectableContainer] doesn't support a + // non-selected color + color: groupValue != value + ? Theme.of(context).colorScheme.onInverseSurface + : null, + child: YaruSelectableContainer( + selected: groupValue == value, + selectionColor: + Theme.of(context).colorScheme.tertiaryContainer.withOpacity(0.8), + padding: EdgeInsets.zero, + child: YaruRadioListTile( + contentPadding: const EdgeInsets.all(6), + visualDensity: VisualDensity.standard, + dense: true, + title: Text( + title, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w500, + ), + ), + subtitle: subtitle != null ? Text(subtitle!) : null, + value: value, + groupValue: groupValue, + onChanged: onChanged, + ), ), ); }