morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::LayoutHints Struct Reference

A widget's size request in both dimensions, and the bounds its extent is clamped into. More...

#include <view.hpp>

Public Member Functions

bool operator== (LayoutHints const &) const =default
 Memberwise equality.

Public Attributes

Sizing width {}
 Along the horizontal axis.
Sizing height {}
 Along the vertical axis.
std::optional< int > minWidth
 The least width, in backend units; nullopt for none.
std::optional< int > maxWidth
 The most width, in backend units; nullopt for none.
std::optional< int > minHeight
 The least height, in backend units; nullopt for none.
std::optional< int > maxHeight
 The most height, in backend units; nullopt for none.
std::optional< Align > alignSelf
 Where the node sits across its row's, column's or grid row's axis; nullopt takes the container's align.

Detailed Description

A widget's size request in both dimensions, and the bounds its extent is clamped into.

A bound clamps the extent the sizing gives, whatever the sizing: a stretch child's share stops at its maximum and a content or fixed child takes at least its minimum. A negative bound, a minimum above its maximum and a fixed amount outside its bounds are refused at mount (std::logic_error).

Definition at line 308 of file view.hpp.

Member Function Documentation

◆ operator==()

bool morph::ui::LayoutHints::operator== ( LayoutHints const & ) const
default

Memberwise equality.

Returns
Whether the sizings, the bounds and the alignment match.

Member Data Documentation

◆ width

Sizing morph::ui::LayoutHints::width {}

Along the horizontal axis.

Definition at line 310 of file view.hpp.

◆ height

Sizing morph::ui::LayoutHints::height {}

Along the vertical axis.

Definition at line 312 of file view.hpp.

◆ minWidth

std::optional<int> morph::ui::LayoutHints::minWidth

The least width, in backend units; nullopt for none.

Definition at line 314 of file view.hpp.

◆ maxWidth

std::optional<int> morph::ui::LayoutHints::maxWidth

The most width, in backend units; nullopt for none.

Definition at line 316 of file view.hpp.

◆ minHeight

std::optional<int> morph::ui::LayoutHints::minHeight

The least height, in backend units; nullopt for none.

Definition at line 318 of file view.hpp.

◆ maxHeight

std::optional<int> morph::ui::LayoutHints::maxHeight

The most height, in backend units; nullopt for none.

Definition at line 320 of file view.hpp.

◆ alignSelf

std::optional<Align> morph::ui::LayoutHints::alignSelf

Where the node sits across its row's, column's or grid row's axis; nullopt takes the container's align.

Definition at line 323 of file view.hpp.


The documentation for this struct was generated from the following file: