Updownquark / Quick

Quark's User Interface Creation Kit
0 stars 0 forks source link

GroupLayout #75

Open Updownquark opened 7 years ago

Updownquark commented 7 years ago

Parent:

Children:

Use an algorithm to harmonize all the constraints

E.g. to create a UI like this:

|---------------------------------------|
|         Enter Your Information        |
|    Name:[                            ]|
|     DOB:[Month        \/][DD][YYYY \/]|
|  Height:[                       ] m   |
|  Weight:[                       ] lbs.|
|---------------------------------------|

the QML would look like this:

<block layout="group-layout" direction="down">
    <label align="center">Enter Your Information</label>
    <group align="justify" direction="right">
        <group direction="down">
            <label h-group="name" align="trailing">Name:</label>
            <label h-group="dob" align="trailing">DOB:</label>
            <label h-group="height" align="trailing">Height:</label>
            <label h-group="weight" align="trailing">Weight:</label>
        </group>
        <group direction="down">
            <text-field h-group="name" value="selected.name" />
            <group h-group="dob" direction="right" align="justify">
                <select values="constants.months" selected="selected.dobMonth" />
                <text-field value="selected.dobDay" />
                <select value="constants.dobYears" selected="selected.dobYear" />
            </group>
            <group h-group="height" direction="right" align="justify">
                <spinner value="selected.height" />
                <label v-group="unit">m</label>
            </group>
            <group h-group="weight" direction="right" align="justify">
                <spinner value="selected.weight" />
                <label v-group="unit">lbs.</label>
            </group>
        </group>
    </group>
</block>
Updownquark commented 7 years ago

group elements: