Skip to content

Commit

Permalink
YaruIconButton: handle disabled state (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi authored Oct 17, 2022
1 parent 1821ed1 commit 56281ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/controls/yaru_icon_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ class YaruIconButton extends StatelessWidget {
fixedSize: MaterialStateProperty.all(Size(iconSize, iconSize)),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
if (states.contains(MaterialState.disabled)) {
return colors.primary.withOpacity(0.38);
}
return colors.primary;
}
if (states.contains(MaterialState.disabled)) {
return colors.onSurface.withOpacity(0.38);
}
return colors.onSurface.withOpacity(0.8);
}),
backgroundColor: MaterialStateProperty.resolveWith((states) {
Expand Down

0 comments on commit 56281ea

Please sign in to comment.