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

interaction between states and the visible property #1237

Closed
FlorentBecker opened this issue May 5, 2022 · 1 comment · Fixed by #1242
Closed

interaction between states and the visible property #1237

FlorentBecker opened this issue May 5, 2022 · 1 comment · Fixed by #1242

Comments

@FlorentBecker
Copy link

It seems that whenever the property visible of some component is set in some state s0 of a component but not others, its value for the states where it is not set is false, rather than the expected true. Other properties such as font-size use their default value when they are set in some state but not others.

For instance, the following does not show "Hello world".

Window {
   property<int> niceness: 33;
   greeting := Text {
       text: "Hello world";

       states [
            rude when root.niceness <= 0: {visible: false}
            mannered when root.niceness > 100: {text: "Hello, dearest world"; font-size: 32px;}
       ]
   }
}
@ogoffart
Copy link
Member

ogoffart commented May 6, 2022

Thanks for the bug report!

When creating the state, the compiler doesn't see that the visibility defaults to true. Fixing in #1242

In the mean time, the work around is to add a visible: true; in the element that can be hidden.

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 a pull request may close this issue.

2 participants