From 3262ae2e7a00251a86e1fc97ac1c9870c2249659 Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Mon, 8 Aug 2022 11:13:09 +0200 Subject: [PATCH] WideLayout: icon and text color improvements --- lib/src/yaru_wide_layout.dart | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/src/yaru_wide_layout.dart b/lib/src/yaru_wide_layout.dart index 23ef09c84..2fd31fd10 100644 --- a/lib/src/yaru_wide_layout.dart +++ b/lib/src/yaru_wide_layout.dart @@ -45,6 +45,9 @@ class _YaruWideLayoutState extends State { @override Widget build(BuildContext context) { + final unselectedTextColor = + Theme.of(context).colorScheme.onSurface.withOpacity(0.8); + final selectedTextColor = Theme.of(context).colorScheme.onSurface; return LayoutBuilder( builder: (context, constraint) { return SafeArea( @@ -62,22 +65,26 @@ class _YaruWideLayoutState extends State { BoxConstraints(minHeight: constraint.maxHeight), child: IntrinsicHeight( child: NavigationRail( - selectedIconTheme: IconThemeData( - color: Theme.of(context) - .colorScheme - .primary - .withOpacity(0.9), - ), unselectedIconTheme: IconThemeData( - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.6), + color: unselectedTextColor, ), indicatorColor: Theme.of(context) .colorScheme .onSurface .withOpacity(0.1), + selectedIconTheme: IconThemeData( + color: selectedTextColor, + ), + selectedLabelTextStyle: TextStyle( + overflow: TextOverflow.ellipsis, + color: selectedTextColor, + fontSize: 16, + ), + unselectedLabelTextStyle: TextStyle( + color: unselectedTextColor, + overflow: TextOverflow.ellipsis, + fontSize: 16, + ), backgroundColor: Theme.of(context).backgroundColor, selectedIndex: _selectedIndex, onDestinationSelected: (index) {