Class GroupLayout

Inheritance Relationships

Base Type

Class Documentation

class GroupLayout : public nanogui::Layout

Special layout for widgets grouped by labels.

This widget resembles a box layout in that it arranges a set of widgets vertically. All widgets are indented on the horizontal axis except for Label widgets, which are not indented.

This creates a pleasing layout where a number of widgets are grouped under some high-level heading.

Public Functions

GroupLayout(int margin = 15, int spacing = 6, int groupSpacing = 14, int groupIndent = 20)

Creates a GroupLayout.

Parameters
  • margin: The margin around the widgets added.

  • spacing: The spacing between widgets added.

  • groupSpacing: The spacing between groups (groups are defined by each Label added).

  • groupIndent: The amount to indent widgets in a group (underneath a Label).

int margin() const

The margin of this GroupLayout.

void setMargin(int margin)

Sets the margin of this GroupLayout.

int spacing() const

The spacing between widgets of this GroupLayout.

void setSpacing(int spacing)

Sets the spacing between widgets of this GroupLayout.

int groupIndent() const

The indent of widgets in a group (underneath a Label) of this GroupLayout.

void setGroupIndent(int groupIndent)

Sets the indent of widgets in a group (underneath a Label) of this GroupLayout.

int groupSpacing() const

The spacing between groups of this GroupLayout.

void setGroupSpacing(int groupSpacing)

Sets the spacing between groups of this GroupLayout.

virtual Vector2i preferredSize(NVGcontext *ctx, const Widget *widget) const

See Layout::preferredSize.

virtual void performLayout(NVGcontext *ctx, Widget *widget) const

See Layout::performLayout.

Protected Attributes

int mMargin

The margin of this GroupLayout.

int mSpacing

The spacing between widgets of this GroupLayout.

int mGroupSpacing

The spacing between groups of this GroupLayout.

int mGroupIndent

The indent amount of a group under its defining Label of this GroupLayout.