TermOx
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ox::Size_policy Class Reference

Defines how a Layout should resize a Widget in one length Dimension. More...

#include <size_policy.hpp>

Public Member Functions

 Size_policy (int hint=0, int min=0, int max=maximum_max, double stretch=1., bool can_ignore_min=true)
 
 Size_policy (Size_policy const &x)
 Does not copy the Signal, so no slots are connected on copy init.
 
 Size_policy (Size_policy &&x)
 Does not move the Signal, so no slots are connected on move init.
 
auto operator= (Size_policy const &x) -> Size_policy &
 Specifically does not copy the Signal, so Widget is still notified.
 
auto operator= (Size_policy &&x) -> Size_policy &
 Specifically does not copy the Signal, so Widget is still notified.
 
void hint (int value)
 Set the size hint, used as the initial value in calculations.
 
auto hint () const -> int
 Return the size hint currently being used.
 
void min (int value)
 Set the minimum length that the owning Widget should be.
 
auto min () const -> int
 Return the minimum length currently set.
 
void max (int value)
 Set the maximum length/height that the owning Widget can be.
 
auto max () const -> int
 Return the maximum length currently set.
 
void stretch (double value)
 Set the stretch value, used to divide up space between sibling Widgets. More...
 
auto stretch () const -> double
 Return the stretch value currently being used.
 
void can_ignore_min (bool enable)
 Set if min can be ignored for the last displayed widget in a layout.
 
auto can_ignore_min () const -> bool
 Return if min can be ignored for the last displayed widget in a layout.
 

Static Public Member Functions

static auto fixed (int hint) -> Size_policy
 Fixed: hint is the only acceptable size.
 
static auto minimum (int hint) -> Size_policy
 Minimum: hint is the minimum acceptable size, may be larger.
 
static auto maximum (int hint) -> Size_policy
 Maximum: hint is the maximum acceptable size, may be smaller.
 
static auto preferred (int hint) -> Size_policy
 Preferred: hint is preferred, though it can be any size.
 
static auto expanding (int hint) -> Size_policy
 Expanding: hint is preferred, but it will expand to use extra space.
 
static auto minimum_expanding (int hint) -> Size_policy
 Minimum Expanding: hint is minimum, it will expand into unused space.
 
static auto ignored () -> Size_policy
 Ignored: Stretch is the only consideration.
 

Public Attributes

sl::Signal< void()> policy_updated
 Emitted on any changes to the Size_policy.
 

Static Public Attributes

static constexpr auto maximum_max
 Largest possible value for max(). More...
 

Friends

auto operator== (Size_policy const &a, Size_policy const &b) -> bool
 
auto operator!= (Size_policy const &a, Size_policy const &b) -> bool
 

Detailed Description

Defines how a Layout should resize a Widget in one length Dimension.

Member Function Documentation

◆ stretch()

void ox::Size_policy::stretch ( double  value)

Set the stretch value, used to divide up space between sibling Widgets.

A ratio of stretch over siblings' stretch sum is used to give space.

Member Data Documentation

◆ maximum_max

constexpr auto ox::Size_policy::maximum_max
staticconstexpr
Initial value:
=
std::numeric_limits<decltype(data_.max)>::max()
auto max() const -> int
Return the maximum length currently set.
Definition: size_policy.cpp:38

Largest possible value for max().


The documentation for this class was generated from the following files: