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 best fit container.
The HdySqueezer
widget is a container which only shows the first of its
children that fits in the available size. It is convenient to offer different
widgets to represent the same data with different levels of detail, making
the widget seem to squeeze itself to fit in the available space.
Transitions between children can be animated as fades. This can be controlled
with [methodsqueezer
.set_transition_type].
CSS nodes
HdySqueezer
has a single CSS node with name squeezer
.
Since: 1.0
Synopsis
- newtype Squeezer = Squeezer (ManagedPtr Squeezer)
- class (GObject o, IsDescendantOf Squeezer o) => IsSqueezer o
- toSqueezer :: (MonadIO m, IsSqueezer o) => o -> m Squeezer
- squeezerGetChildEnabled :: (HasCallStack, MonadIO m, IsSqueezer a, IsWidget b) => a -> b -> m Bool
- squeezerGetHomogeneous :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m Bool
- squeezerGetInterpolateSize :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m Bool
- squeezerGetTransitionDuration :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m Word32
- squeezerGetTransitionRunning :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m Bool
- squeezerGetTransitionType :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m SqueezerTransitionType
- squeezerGetVisibleChild :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m (Maybe Widget)
- squeezerGetXalign :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m Float
- squeezerGetYalign :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> m Float
- squeezerNew :: (HasCallStack, MonadIO m) => m Squeezer
- squeezerSetChildEnabled :: (HasCallStack, MonadIO m, IsSqueezer a, IsWidget b) => a -> b -> Bool -> m ()
- squeezerSetHomogeneous :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> Bool -> m ()
- squeezerSetInterpolateSize :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> Bool -> m ()
- squeezerSetTransitionDuration :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> Word32 -> m ()
- squeezerSetTransitionType :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> SqueezerTransitionType -> m ()
- squeezerSetXalign :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> Float -> m ()
- squeezerSetYalign :: (HasCallStack, MonadIO m, IsSqueezer a) => a -> Float -> m ()
- constructSqueezerHomogeneous :: (IsSqueezer o, MonadIO m) => Bool -> m (GValueConstruct o)
- getSqueezerHomogeneous :: (MonadIO m, IsSqueezer o) => o -> m Bool
- setSqueezerHomogeneous :: (MonadIO m, IsSqueezer o) => o -> Bool -> m ()
- constructSqueezerInterpolateSize :: (IsSqueezer o, MonadIO m) => Bool -> m (GValueConstruct o)
- getSqueezerInterpolateSize :: (MonadIO m, IsSqueezer o) => o -> m Bool
- setSqueezerInterpolateSize :: (MonadIO m, IsSqueezer o) => o -> Bool -> m ()
- constructSqueezerTransitionDuration :: (IsSqueezer o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getSqueezerTransitionDuration :: (MonadIO m, IsSqueezer o) => o -> m Word32
- setSqueezerTransitionDuration :: (MonadIO m, IsSqueezer o) => o -> Word32 -> m ()
- getSqueezerTransitionRunning :: (MonadIO m, IsSqueezer o) => o -> m Bool
- constructSqueezerTransitionType :: (IsSqueezer o, MonadIO m) => SqueezerTransitionType -> m (GValueConstruct o)
- getSqueezerTransitionType :: (MonadIO m, IsSqueezer o) => o -> m SqueezerTransitionType
- setSqueezerTransitionType :: (MonadIO m, IsSqueezer o) => o -> SqueezerTransitionType -> m ()
- getSqueezerVisibleChild :: (MonadIO m, IsSqueezer o) => o -> m (Maybe Widget)
- constructSqueezerXalign :: (IsSqueezer o, MonadIO m) => Float -> m (GValueConstruct o)
- getSqueezerXalign :: (MonadIO m, IsSqueezer o) => o -> m Float
- setSqueezerXalign :: (MonadIO m, IsSqueezer o) => o -> Float -> m ()
- constructSqueezerYalign :: (IsSqueezer o, MonadIO m) => Float -> m (GValueConstruct o)
- getSqueezerYalign :: (MonadIO m, IsSqueezer o) => o -> m Float
- setSqueezerYalign :: (MonadIO m, IsSqueezer o) => o -> Float -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Squeezer Source # | |
GObject Squeezer Source # | |
Defined in GI.Handy.Objects.Squeezer | |
ManagedPtrNewtype Squeezer Source # | |
Defined in GI.Handy.Objects.Squeezer toManagedPtr :: Squeezer -> ManagedPtr Squeezer | |
TypedObject Squeezer Source # | |
Defined in GI.Handy.Objects.Squeezer | |
HasParentTypes Squeezer Source # | |
Defined in GI.Handy.Objects.Squeezer | |
IsGValue (Maybe Squeezer) Source # | Convert |
Defined in GI.Handy.Objects.Squeezer gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Squeezer -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Squeezer) | |
type ParentTypes Squeezer Source # | |
Defined in GI.Handy.Objects.Squeezer type ParentTypes Squeezer = '[Container, Widget, Object, ImplementorIface, Buildable, Orientable] |
class (GObject o, IsDescendantOf Squeezer o) => IsSqueezer o Source #
Type class for types which can be safely cast to Squeezer
, for instance with toSqueezer
.
Instances
(GObject o, IsDescendantOf Squeezer o) => IsSqueezer o Source # | |
Defined in GI.Handy.Objects.Squeezer |
toSqueezer :: (MonadIO m, IsSqueezer o) => o -> m Squeezer Source #
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, getChildEnabled, 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, getHomogeneous, getInternalChild, getInterpolateSize, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, 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, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getTransitionDuration, getTransitionRunning, getTransitionType, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisibleChild, getVisual, getWindow, getXalign, getYalign.
Setters
setAccelPath, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildEnabled, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setHomogeneous, setInterpolateSize, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setTransitionDuration, setTransitionType, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow, setXalign, setYalign.
getChildEnabled
squeezerGetChildEnabled Source #
:: (HasCallStack, MonadIO m, IsSqueezer a, IsWidget b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: whether |
Gets whether child
is enabled.
See [methodsqueezer
.set_child_enabled].
Since: 1.0
getHomogeneous
squeezerGetHomogeneous Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
is homogeneous.
Since: 1.0
getInterpolateSize
squeezerGetInterpolateSize Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
should interpolate its size on visible child change.
Since: 1.0
getTransitionDuration
squeezerGetTransitionDuration Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m Word32 | Returns: the transition duration, in milliseconds |
Gets the amount of time that transitions between children will take.
Since: 1.0
getTransitionRunning
squeezerGetTransitionRunning Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m Bool | Returns: whether a transition is currently running |
Gets whether a transition is currently running for self
.
Since: 1.0
getTransitionType
squeezerGetTransitionType Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m SqueezerTransitionType | Returns: the current transition type of |
Gets the animation type that will be used for transitions between children.
Since: 1.0
getVisibleChild
squeezerGetVisibleChild Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the visible child |
Gets the currently visible child of self
.
Since: 1.0
getXalign
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m Float | Returns: the xalign property |
Gets the horizontal alignment.
Since: 1.0
getYalign
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> m Float | Returns: the yalign property |
Gets the vertical alignment.
Since: 1.0
new
:: (HasCallStack, MonadIO m) | |
=> m Squeezer | Returns: the newly created |
Creates a new HdySqueezer
.
Since: 1.0
setChildEnabled
squeezerSetChildEnabled Source #
:: (HasCallStack, MonadIO m, IsSqueezer a, IsWidget b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> m () |
Sets whether child
is enabled.
If a child is disabled, it will be ignored when looking for the child fitting
the available size best. This allows to programmatically and prematurely hide
a child of self
even if it fits in the available space.
This can be used e.g. to ensure a certain child is hidden below a certain window width, or any other constraint you find suitable.
Since: 1.0
setHomogeneous
squeezerSetHomogeneous Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether all children have the same size for the opposite orientation.
Since: 1.0
setInterpolateSize
squeezerSetInterpolateSize Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether self
should interpolate its size on visible child change.
Since: 1.0
setTransitionDuration
squeezerSetTransitionDuration Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets the duration that transitions between children in self
will take.
Since: 1.0
setTransitionType
squeezerSetTransitionType Source #
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> SqueezerTransitionType |
|
-> m () |
Sets the animation type that will be used for transitions between children.
Since: 1.0
setXalign
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> Float |
|
-> m () |
Sets the horizontal alignment.
Since: 1.0
setYalign
:: (HasCallStack, MonadIO m, IsSqueezer a) | |
=> a |
|
-> Float |
|
-> m () |
Sets the vertical alignment.
Since: 1.0
Properties
homogeneous
Whether all children have the same size for the opposite orientation.
For example, if a squeezer is horizontal and is homogeneous, it will request the same height for all its children. If it isn't, the squeezer may change size when a different child becomes visible.
Since: 1.0
constructSqueezerHomogeneous :: (IsSqueezer o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “homogeneous
” property. This is rarely needed directly, but it is used by new
.
getSqueezerHomogeneous :: (MonadIO m, IsSqueezer o) => o -> m Bool Source #
Get the value of the “homogeneous
” property.
When overloading is enabled, this is equivalent to
get
squeezer #homogeneous
setSqueezerHomogeneous :: (MonadIO m, IsSqueezer o) => o -> Bool -> m () Source #
Set the value of the “homogeneous
” property.
When overloading is enabled, this is equivalent to
set
squeezer [ #homogeneous:=
value ]
interpolateSize
Whether the squeezer interpolates its size when changing the visible child.
If TRUE
, the squeezer will interpolate its size between the one of the
previous visible child and the one of the new visible child, according to
the set transition duration and the orientation, e.g. if the squeezer is
horizontal, it will interpolate the its height.
Since: 1.0
constructSqueezerInterpolateSize :: (IsSqueezer o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “interpolate-size
” property. This is rarely needed directly, but it is used by new
.
getSqueezerInterpolateSize :: (MonadIO m, IsSqueezer o) => o -> m Bool Source #
Get the value of the “interpolate-size
” property.
When overloading is enabled, this is equivalent to
get
squeezer #interpolateSize
setSqueezerInterpolateSize :: (MonadIO m, IsSqueezer o) => o -> Bool -> m () Source #
Set the value of the “interpolate-size
” property.
When overloading is enabled, this is equivalent to
set
squeezer [ #interpolateSize:=
value ]
transitionDuration
The animation duration, in milliseconds.
Since: 1.0
constructSqueezerTransitionDuration :: (IsSqueezer o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “transition-duration
” property. This is rarely needed directly, but it is used by new
.
getSqueezerTransitionDuration :: (MonadIO m, IsSqueezer o) => o -> m Word32 Source #
Get the value of the “transition-duration
” property.
When overloading is enabled, this is equivalent to
get
squeezer #transitionDuration
setSqueezerTransitionDuration :: (MonadIO m, IsSqueezer o) => o -> Word32 -> m () Source #
Set the value of the “transition-duration
” property.
When overloading is enabled, this is equivalent to
set
squeezer [ #transitionDuration:=
value ]
transitionRunning
Whether a transition is currently running.
Since: 1.0
getSqueezerTransitionRunning :: (MonadIO m, IsSqueezer o) => o -> m Bool Source #
Get the value of the “transition-running
” property.
When overloading is enabled, this is equivalent to
get
squeezer #transitionRunning
transitionType
The type of animation used for transitions between children.
Available types include various kinds of fades and slides.
The transition type can be changed without problems at runtime, so it is possible to change the animation based on the child that is about to become current.
Since: 1.0
constructSqueezerTransitionType :: (IsSqueezer o, MonadIO m) => SqueezerTransitionType -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “transition-type
” property. This is rarely needed directly, but it is used by new
.
getSqueezerTransitionType :: (MonadIO m, IsSqueezer o) => o -> m SqueezerTransitionType Source #
Get the value of the “transition-type
” property.
When overloading is enabled, this is equivalent to
get
squeezer #transitionType
setSqueezerTransitionType :: (MonadIO m, IsSqueezer o) => o -> SqueezerTransitionType -> m () Source #
Set the value of the “transition-type
” property.
When overloading is enabled, this is equivalent to
set
squeezer [ #transitionType:=
value ]
visibleChild
The currently visible child.
Since: 1.0
getSqueezerVisibleChild :: (MonadIO m, IsSqueezer o) => o -> m (Maybe Widget) Source #
Get the value of the “visible-child
” property.
When overloading is enabled, this is equivalent to
get
squeezer #visibleChild
xalign
The horizontal alignment, from 0 (start) to 1 (end).
The xalign property determines the horizontal alignment of the children inside the squeezer's size allocation. Compare this to Widget:halign, which determines how the squeezer's size allocation is positioned in the space available for the squeezer.
This will affect the position of children too wide to fit in the squeezer as they are fading out.
Since: 1.0
constructSqueezerXalign :: (IsSqueezer o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “xalign
” property. This is rarely needed directly, but it is used by new
.
getSqueezerXalign :: (MonadIO m, IsSqueezer o) => o -> m Float Source #
Get the value of the “xalign
” property.
When overloading is enabled, this is equivalent to
get
squeezer #xalign
setSqueezerXalign :: (MonadIO m, IsSqueezer o) => o -> Float -> m () Source #
Set the value of the “xalign
” property.
When overloading is enabled, this is equivalent to
set
squeezer [ #xalign:=
value ]
yalign
The vertical alignment, from 0 (start) to 1 (end).
The yalign property determines the vertical alignment of the children inside the squeezer's size allocation. Compare this to Widget:valign, which determines how the squeezer's size allocation is positioned in the space available for the squeezer.
This will affect the position of children too tall to fit in the squeezer as they are fading out.
Since: 1.0
constructSqueezerYalign :: (IsSqueezer o, MonadIO m) => Float -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “yalign
” property. This is rarely needed directly, but it is used by new
.
getSqueezerYalign :: (MonadIO m, IsSqueezer o) => o -> m Float Source #
Get the value of the “yalign
” property.
When overloading is enabled, this is equivalent to
get
squeezer #yalign
setSqueezerYalign :: (MonadIO m, IsSqueezer o) => o -> Float -> m () Source #
Set the value of the “yalign
” property.
When overloading is enabled, this is equivalent to
set
squeezer [ #yalign:=
value ]