gi-handy-1.0.4: libhandy bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Handy.Objects.Clamp

Description

A widget constraining its child to a given size.

The HdyClamp 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

HdyClamp has a single CSS node with name clamp.

The node will get the style classes .large when its child reached its maximum size, .small when the clamp allocates its full size to its child, .medium in-between, or none if it didn't compute 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.Handy.Objects.Clamp

Methods

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

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

GObject Clamp Source # 
Instance details

Defined in GI.Handy.Objects.Clamp

ManagedPtrNewtype Clamp Source # 
Instance details

Defined in GI.Handy.Objects.Clamp

Methods

toManagedPtr :: Clamp -> ManagedPtr Clamp

TypedObject Clamp Source # 
Instance details

Defined in GI.Handy.Objects.Clamp

Methods

glibType :: IO GType

HasParentTypes Clamp Source # 
Instance details

Defined in GI.Handy.Objects.Clamp

IsGValue (Maybe Clamp) Source #

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

Instance details

Defined in GI.Handy.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.Handy.Objects.Clamp

type ParentTypes Clamp = '[Bin, Container, Widget, Object, ImplementorIface, Buildable, 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.Handy.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

activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.

Getters

getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getMaximumSize, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTighteningThreshold, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.

Setters

setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setMaximumSize, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTighteningThreshold, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

getMaximumSize

clampGetMaximumSize Source #

Arguments

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

self: a clamp

-> m Int32

Returns: the maximum size to allocate to the children

Gets the maximum size allocated to the children.

Since: 1.0

getTighteningThreshold

clampGetTighteningThreshold Source #

Arguments

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

self: a clamp

-> m Int32

Returns: the size above which the children are clamped

Gets the size above which the children are clamped.

Since: 1.0

new

clampNew Source #

Arguments

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

Returns: the newly created HdyClamp

Creates a new HdyClamp.

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 children.

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 children are clamped.

Since: 1.0

Properties

maximumSize

The maximum size to allocate the children.

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 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.

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 ]