Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype Clamp = Clamp (ManagedPtr Clamp)
- class (GObject o, IsDescendantOf Clamp o) => IsClamp o
- toClamp :: (MonadIO m, IsClamp o) => o -> m Clamp
- clampGetMaximumSize :: (HasCallStack, MonadIO m, IsClamp a) => a -> m Int32
- clampGetTighteningThreshold :: (HasCallStack, MonadIO m, IsClamp a) => a -> m Int32
- clampNew :: (HasCallStack, MonadIO m) => m Clamp
- clampSetMaximumSize :: (HasCallStack, MonadIO m, IsClamp a) => a -> Int32 -> m ()
- clampSetTighteningThreshold :: (HasCallStack, MonadIO m, IsClamp a) => a -> Int32 -> m ()
- constructClampMaximumSize :: (IsClamp o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getClampMaximumSize :: (MonadIO m, IsClamp o) => o -> m Int32
- setClampMaximumSize :: (MonadIO m, IsClamp o) => o -> Int32 -> m ()
- constructClampTighteningThreshold :: (IsClamp o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getClampTighteningThreshold :: (MonadIO m, IsClamp o) => o -> m Int32
- setClampTighteningThreshold :: (MonadIO m, IsClamp o) => o -> Int32 -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Clamp Source # | |
GObject Clamp Source # | |
Defined in GI.Handy.Objects.Clamp | |
ManagedPtrNewtype Clamp Source # | |
Defined in GI.Handy.Objects.Clamp toManagedPtr :: Clamp -> ManagedPtr Clamp | |
TypedObject Clamp Source # | |
Defined in GI.Handy.Objects.Clamp | |
HasParentTypes Clamp Source # | |
Defined in GI.Handy.Objects.Clamp | |
IsGValue (Maybe Clamp) Source # | Convert |
Defined in GI.Handy.Objects.Clamp gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Clamp -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Clamp) | |
type ParentTypes Clamp Source # | |
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 #
Instances
(GObject o, IsDescendantOf Clamp o) => IsClamp o Source # | |
Defined in GI.Handy.Objects.Clamp |
Methods
Click to display all available methods, including inherited ones
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
:: (HasCallStack, MonadIO m, IsClamp a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsClamp a) | |
=> a |
|
-> m Int32 | Returns: the size above which the children are clamped |
Gets the size above which the children are clamped.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m Clamp | Returns: the newly created |
Creates a new HdyClamp
.
Since: 1.0
setMaximumSize
:: (HasCallStack, MonadIO m, IsClamp a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the maximum size allocated to the children.
Since: 1.0
setTighteningThreshold
clampSetTighteningThreshold Source #
:: (HasCallStack, MonadIO m, IsClamp a) | |
=> a |
|
-> Int32 |
|
-> 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 ]