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.

Constructors

this
this(NodeParams params, SizeLimit limit, T args)
Undocumented in source.
this
deprecated this(BasicNodeParam!i params, SizeLimit limit, T args)
Undocumented in source.

Members

Functions

resizeImpl
void resizeImpl(Vector2 space)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin DefineStyles
Undocumented in source.

Variables

limit
SizeLimit limit;

The maximum size of this node. If a value on either axis is 0, limit will not be applied on the axis.

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