sizeLock

sizeLock "locks" a node, restricting space avilable to it, and making it fill the space, if possible.

Size-locks are extremely useful for responsible applications, making sure the content doesn't span too much space on large screens, for example on wide-screen, where the content can be applied a sizeLimitX, so it never spreads to more than the set value.

@safe
alias sizeLock(alias T) = simpleConstructor!(SizeLock, T)

Examples

import fluid;

// The frame will appear horizontally-centered in the parent node, while filling it vertically
sizeLock!vframe(
    layout!(1, "center", "fill"),
    sizeLimitX(400),

    label("Hello, World!")
);

Meta