Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(YaruWindowControl)!: use material state properties for colors #859

Merged
merged 2 commits into from Mar 3, 2024

Conversation

Jupi007
Copy link
Member

@Jupi007 Jupi007 commented Mar 2, 2024

This PR fix the property name, and add more flexibility in the way you can customize the colors:

YaruWindowControl(
  ...
  backgroundColor:
      MaterialStateProperty.resolveWith((states) {
    if (states.contains(MaterialState.pressed)) {
      return Colors.green;
    }
    if (states.contains(MaterialState.hovered)) {
      return Colors.blue;
    }
    if (states.contains(MaterialState.disabled)) {
      return Colors.yellow;
    }
    return null;
  }),
),

@Jupi007 Jupi007 requested a review from Feichtmeier March 2, 2024 22:45
Copy link
Member

@Feichtmeier Feichtmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool ty!
need to double check in musicpod if this hits all the weird edge cases but LGTM on the table

@Feichtmeier Feichtmeier merged commit cfce3d4 into ubuntu:main Mar 3, 2024
7 checks passed
@Jupi007 Jupi007 deleted the yaruWindowControl-materialState branch March 3, 2024 07:04
@github-actions github-actions bot mentioned this pull request Mar 3, 2024
@Jupi007
Copy link
Member Author

Jupi007 commented Mar 3, 2024

It should be reacting in the same way as previously if you use MaterialStatePropertyAll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants