gi-adwaita-1.0.5: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Objects.ClampLayout

Description

A layout manager constraining its children to a given size.

<picture> <source srcset="clamp-wide-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-wide.png" alt="clamp-wide"> </picture> <picture> <source srcset="clamp-narrow-dark.png" media="(prefers-color-scheme: dark)"> <img src="clamp-narrow.png" alt="clamp-narrow"> </picture>

AdwClampLayout constraints the size of the widgets it contains to a given maximum size. It will constrain the width if it is horizontal, or the height if it is vertical. The expansion of the children from their minimum to their maximum size is eased out for a smooth transition.

If a child requires more than the requested maximum size, it will be allocated the minimum size it can fit in instead.

Each child will get the style classes .large when it reached its maximum size, .small when it's allocated the full size, .medium in-between, or none if it hasn't been allocated yet.

Synopsis

Exported types

newtype ClampLayout Source #

Memory-managed wrapper type.

Constructors

ClampLayout (ManagedPtr ClampLayout) 

Instances

Instances details
Eq ClampLayout Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

GObject ClampLayout Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

ManagedPtrNewtype ClampLayout Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

Methods

toManagedPtr :: ClampLayout -> ManagedPtr ClampLayout

TypedObject ClampLayout Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

Methods

glibType :: IO GType

HasParentTypes ClampLayout Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

IsGValue (Maybe ClampLayout) Source #

Convert ClampLayout to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Adw.Objects.ClampLayout

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ClampLayout -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ClampLayout)

type ParentTypes ClampLayout Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

type ParentTypes ClampLayout = '[LayoutManager, Object, Orientable]

class (GObject o, IsDescendantOf ClampLayout o) => IsClampLayout o Source #

Type class for types which can be safely cast to ClampLayout, for instance with toClampLayout.

Instances

Instances details
(GObject o, IsDescendantOf ClampLayout o) => IsClampLayout o Source # 
Instance details

Defined in GI.Adw.Objects.ClampLayout

toClampLayout :: (MonadIO m, IsClampLayout o) => o -> m ClampLayout Source #

Cast to ClampLayout, for types for which this is known to be safe. For general casts, use castTo.

Methods

getMaximumSize

clampLayoutGetMaximumSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsClampLayout a) 
=> a

self: a clamp layout

-> m Int32

Returns: the maximum size to allocate to the children

Gets the maximum size allocated to the children.

getTighteningThreshold

clampLayoutGetTighteningThreshold Source #

Arguments

:: (HasCallStack, MonadIO m, IsClampLayout a) 
=> a

self: a clamp layout

-> m Int32

Returns: the size above which the children are clamped

Gets the size above which the children are clamped.

new

clampLayoutNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ClampLayout

Returns: the newly created AdwClampLayout

Creates a new AdwClampLayout.

setMaximumSize

clampLayoutSetMaximumSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsClampLayout a) 
=> a

self: a clamp layout

-> Int32

maximumSize: the maximum size

-> m () 

Sets the maximum size allocated to the children.

It is the width if the layout is horizontal, or the height if it is vertical.

setTighteningThreshold

clampLayoutSetTighteningThreshold Source #

Arguments

:: (HasCallStack, MonadIO m, IsClampLayout a) 
=> a

self: a clamp layout

-> Int32

tighteningThreshold: the tightening threshold

-> m () 

Sets the size above which the children are clamped.

Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

Properties

maximumSize

The maximum size to allocate to the children.

It is the width if the layout is horizontal, or the height if it is vertical.

constructClampLayoutMaximumSize :: (IsClampLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “maximum-size” property. This is rarely needed directly, but it is used by new.

getClampLayoutMaximumSize :: (MonadIO m, IsClampLayout o) => o -> m Int32 Source #

Get the value of the “maximum-size” property. When overloading is enabled, this is equivalent to

get clampLayout #maximumSize

setClampLayoutMaximumSize :: (MonadIO m, IsClampLayout o) => o -> Int32 -> m () Source #

Set the value of the “maximum-size” property. When overloading is enabled, this is equivalent to

set clampLayout [ #maximumSize := value ]

tighteningThreshold

The size above which the children are clamped.

Starting from this size, the layout will tighten its grip on the children, slowly allocating less and less of the available size up to the maximum allocated size. Below that threshold and below the maximum size, the children will be allocated all the available size.

If the threshold is greater than the maximum size to allocate to the children, they will be allocated the whole size up to the maximum. If the threshold is lower than the minimum size to allocate to the children, that size will be used as the tightening threshold.

Effectively, tightening the grip on a child before it reaches its maximum size makes transitions to and from the maximum size smoother when resizing.

constructClampLayoutTighteningThreshold :: (IsClampLayout o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “tightening-threshold” property. This is rarely needed directly, but it is used by new.

getClampLayoutTighteningThreshold :: (MonadIO m, IsClampLayout o) => o -> m Int32 Source #

Get the value of the “tightening-threshold” property. When overloading is enabled, this is equivalent to

get clampLayout #tighteningThreshold

setClampLayoutTighteningThreshold :: (MonadIO m, IsClampLayout o) => o -> Int32 -> m () Source #

Set the value of the “tightening-threshold” property. When overloading is enabled, this is equivalent to

set clampLayout [ #tighteningThreshold := value ]