Skip to content
Discussion options

You must be logged in to vote

This hasn't been tested, but you should be able to use the ternary operator:

 enum Pages {
        Login,
        Chat,
    }

    export component MainWindow inherits Window {
        in-out property <Pages> current_page: Pages.Login;

        if (current_page == Pages.Login): LoginForm {
            width: root.width > 512px ? 512px : root.width/2 ;
            service: "Discord";
        }

    }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@laycookie
Comment options

Answer selected by laycookie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants