Skip to content

Commit

Permalink
Merge pull request 'Implement grid' (#66) from grid into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthaTi committed Apr 16, 2022
2 parents 0f6f53f + ac8af73 commit 3186df9
Show file tree
Hide file tree
Showing 3 changed files with 401 additions and 1 deletion.
37 changes: 36 additions & 1 deletion examples/showcase_2.d
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ void main() {
// Add children nodes
boxExample,
inputExample,
slotExample,
gridExample,
sizeLimitExample,
slotExample,
);

while (!WindowShouldClose) {
Expand All @@ -65,13 +66,15 @@ void main() {
GluiSpace boxExample() {

auto root = vspace(
.layout!"fill",

label(.layout!"center", "Boxes"),

label("To make it easier to style your interface, Glui has a box system similar to HTML."),

// Space for the boxes so we can make their width align
vspace(
.layout!"center",

hspace(
.layout!"fill",
Expand Down Expand Up @@ -385,3 +388,35 @@ GluiSpace sizeLimitExample() {
return root;

}

GluiSpace gridExample() {

GluiSpace root;

root = vspace(
.layout!"fill",

label(.layout!"center", "Grids"),

grid(
.layout!"fill",
.segments!4,

label("You can make tables and grids with GluiGrid"),
[
label("This"),
label("Is"),
label("A"),
label("Grid"),
],
[
label(.segments!2, "Multiple columns"),
label(.segments!2, "For a single cell"),
],
),

);

return root;

}
Loading

0 comments on commit 3186df9

Please sign in to comment.