Skip to content

Commit

Permalink
Use filled icon on theme selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
braniii committed Oct 11, 2024
1 parent e04f422 commit 29378e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/lib/core/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ extension CustomThemeModeEncoding on ThemeMode {
ThemeMode.dark: PhosphorIconsDuotone.moon,
ThemeMode.system: PhosphorIconsDuotone.cloudSun,
}[this]!;

/// get icon
IconData get activeIcon => <ThemeMode, IconData>{
ThemeMode.light: PhosphorIconsFill.sun,
ThemeMode.dark: PhosphorIconsFill.moon,
ThemeMode.system: PhosphorIconsFill.cloudSun,
}[this]!;
}

/// extension of theme
Expand Down
7 changes: 6 additions & 1 deletion app/lib/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,12 @@ class DarkModeListTile extends StatelessWidget {
ButtonSegment<ThemeMode>(
value: mode,
tooltip: mode.nameLong(context),
icon: PPIcon(mode.icon, context),
icon: PPIcon(
Provider.of<TraleNotifier>(context).themeMode == mode
? mode.activeIcon
: mode.icon,
context,
),
)
],
onSelectionChanged: (Set<ThemeMode> newMode) async {
Expand Down

0 comments on commit 29378e9

Please sign in to comment.