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

Suggestion: Make Layout Classes chainable #212

Open
curly-brace opened this issue Jul 13, 2015 · 0 comments
Open

Suggestion: Make Layout Classes chainable #212

curly-brace opened this issue Jul 13, 2015 · 0 comments

Comments

@curly-brace
Copy link

make all properties return class instance instead of assigned value.

so instead of having this code:

UIBuilder.create(Widget, {
    defaults: 'Header',
    layout: {
        var l = new Column();
        l.cols = [24, -1, 24, 24, 24];
        l.cellPadding = 4;
        l.paddingTop = 4;
        l.paddingBottom = 4;
        l.paddingLeft = 4;
        l.paddingRight = 12;
        l;
    }
}

we can have just:

UIBuilder.create(Widget, {
    defaults: 'Header',
    layout: new Column()
        .cols([24, -1, 24, 24, 24])
        .cellPadding(4)
        .paddingTop(4)
        .paddingBottom(4)
        .paddingLeft(4)
        .paddingRight(12)
}

May be it would be helpful also in other classes, like skins (creating on the fly)

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

No branches or pull requests

1 participant