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

Add utilities for layout with Cassowary #7

Open
ghost opened this issue Jan 28, 2015 · 0 comments
Open

Add utilities for layout with Cassowary #7

ghost opened this issue Jan 28, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 28, 2015

The most common usecase of this library, layout, is still kinda cumbersome with this library since one still needs to map all the values to and from the Cassowary variables. It would be nice to have sensible defaults and utilities to be able to write code like this:

import Aqt.Cassowary.Layout 1.0

Layout {
    id: root

    Constraint { expr: eq(button2.left, plus(button1.right, 20)) }
    Constraint { expr: eq(root.horizontalCenter, divide(plus(button1.left, button2.right), 2)) }

    Anchors {
        id: button1
        Button {}
    }

    Anchors {
        id: button2
        Button {}
    }
}
@ghost ghost added the enhancement label Jan 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

0 participants