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

@radial-gradient does not error when used on a property <color> #6819

Open
bryce-happel-walton opened this issue Nov 18, 2024 · 1 comment
Open
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) diagnostics Suggestions for better diagnostics enhancement New feature or request good first issue Good for newcomers

Comments

@bryce-happel-walton
Copy link

Language: Rust
Platform: Arm64

While messing around with brushes I noticed I wasn't getting the expected results from a gradient. Eventually I figured out that I was passing the macro to a property <color> and passing the property <color> to a property <brush>.

Using gradient macros on property <color> should at least produce a warning. It will truncate the result to the first color provided to the macro, I do not believe this to be an intuitive outcome.

@ogoffart ogoffart added enhancement New feature or request a:compiler Slint compiler internal (not the codegen, not the parser) diagnostics Suggestions for better diagnostics labels Nov 18, 2024
@ogoffart
Copy link
Member

Indeed, it would be worth displaying a warning when the user literally use @...-gradiant macro that is immediately converted to a colour.

The condition can be detected there

let from = match (ty, &target_type) {

@ogoffart ogoffart added the good first issue Good for newcomers label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) diagnostics Suggestions for better diagnostics enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants