gi-adwaita-1.0.3: 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.Clamp

Description

A widget constraining its child 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>

The AdwClamp widget constrains the size of the widget 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 child from its minimum to its maximum size is eased out for a smooth transition.

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

CSS nodes

AdwClamp has a single CSS node with name clamp.

Its children will receive the style classes .large when the child reached its maximum size, .small when the clamp allocates its full size to the child, .medium in-between, or none if it hasn't computed its size yet.

Since: 1.0

Synopsis

Exported types

newtype Clamp Source #

Memory-managed wrapper type.

Constructors

Clamp (ManagedPtr Clamp) 

Instances

Instances details
Eq Clamp Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

Methods

(==) :: Clamp -> Clamp -> Bool #

(/=) :: Clamp -> Clamp -> Bool #

GObject Clamp Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

ManagedPtrNewtype Clamp Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

Methods

toManagedPtr :: Clamp -> ManagedPtr Clamp

TypedObject Clamp Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

Methods

glibType :: IO GType

HasParentTypes Clamp Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

IsGValue (Maybe Clamp) Source #

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

Instance details

Defined in GI.Adw.Objects.Clamp

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Clamp Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

type ParentTypes Clamp = '[Widget, Object, Accessible, Buildable, ConstraintTarget, Orientable]

class (GObject o, IsDescendantOf Clamp o) => IsClamp o Source #

Type class for types which can be safely cast to Clamp, for instance with toClamp.

Instances

Instances details
(GObject o, IsDescendantOf Clamp o) => IsClamp o Source # 
Instance details

Defined in GI.Adw.Objects.Clamp

toClamp :: (MonadIO m, IsClamp o) => o -> m Clamp Source #

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMaximumSize, getName, getNative, getNextSibling, getOpacity, getOrientation, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTighteningThreshold, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMaximumSize, setName, setOpacity, setOrientation, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTighteningThreshold, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

getChild

clampGetChild Source #

Arguments

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

self: a clamp

-> m (Maybe Widget)

Returns: the child widget of self

Gets the child widget of self.

Since: 1.0

getMaximumSize

clampGetMaximumSize Source #

Arguments

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

self: a clamp

-> m Int32

Returns: the maximum size to allocate to the child

Gets the maximum size allocated to the child.

Since: 1.0

getTighteningThreshold

clampGetTighteningThreshold Source #

Arguments

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

self: a clamp

-> m Int32

Returns: the size above which the child is clamped

Gets the size above which the child is clamped.

Since: 1.0

new

clampNew Source #

Arguments

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

Returns: the newly created AdwClamp

Creates a new AdwClamp.

Since: 1.0

setChild

clampSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsClamp a, IsWidget b) 
=> a

self: a clamp

-> Maybe b

child: the child widget

-> m () 

Sets the child widget of self.

Since: 1.0

setMaximumSize

clampSetMaximumSize Source #

Arguments

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

self: a clamp

-> Int32

maximumSize: the maximum size

-> m () 

Sets the maximum size allocated to the child.

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

Since: 1.0

setTighteningThreshold

clampSetTighteningThreshold Source #

Arguments

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

self: a clamp

-> Int32

tighteningThreshold: the tightening threshold

-> m () 

Sets the size above which the child is clamped.

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

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

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

Since: 1.0

Properties

child

The child widget of the AdwClamp.

Since: 1.0

clearClampChild :: (MonadIO m, IsClamp o) => o -> m () Source #

Set the value of the “child” property to Nothing. When overloading is enabled, this is equivalent to

clear #child

constructClampChild :: (IsClamp o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

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

getClampChild :: (MonadIO m, IsClamp o) => o -> m (Maybe Widget) Source #

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

get clamp #child

setClampChild :: (MonadIO m, IsClamp o, IsWidget a) => o -> a -> m () Source #

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

set clamp [ #child := value ]

maximumSize

The maximum size allocated to the child.

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

Since: 1.0

constructClampMaximumSize :: (IsClamp 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.

getClampMaximumSize :: (MonadIO m, IsClamp o) => o -> m Int32 Source #

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

get clamp #maximumSize

setClampMaximumSize :: (MonadIO m, IsClamp o) => o -> Int32 -> m () Source #

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

set clamp [ #maximumSize := value ]

tighteningThreshold

The size above which the child is clamped.

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

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

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

Since: 1.0

constructClampTighteningThreshold :: (IsClamp 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.

getClampTighteningThreshold :: (MonadIO m, IsClamp o) => o -> m Int32 Source #

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

get clamp #tighteningThreshold

setClampTighteningThreshold :: (MonadIO m, IsClamp o) => o -> Int32 -> m () Source #

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

set clamp [ #tighteningThreshold := value ]