Closed levrik closed 2 years ago
Thanks for the report. Looks like the ternary operator always convert to the type of the first operand when both ways are possible.
Will look into it.
@ogoffart Ah, this makes sense. Thanks a lot! I've worked around by ensuring that the gradient always comes first for now.
When using the
@linear-gradient
macro in the 2nd position of the ternary operator, just the first color value found is being used.I simplified the code a lot for demonstration purposes.
These 2 codeblocks can be just copied into
Window
of https://slint-ui.com/releases/0.2.2/editor/ to reproduce.I could work around by moving the gradients into a global and just reference it from inside the ternary operator. Looks like a bug in the parser to me.Edit: Above statement isn't true. It's also not working when using a global.